smallrye / smallrye-common

Common utilities for SmallRye

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Provide basic NIO-based PathUtils

boris-unckel opened this issue · comments

Current IO utility libraries suffer from their early birth and a based on a java.io and java.nio mix.
The approach is to have the file management methods of java.nio.file.Files with io.smallrye.common.constraint.Assert null checks and java.nio.file.Paths parameters. The same methods shall be available for classic java.io.File with underlying NIO to ease legacy use. All methods shall follow a fluent style and throw java.io.UncheckedIOException in error cases.

  • distinct between "exception shows result" (i.E. NotLinkException) and "exception shows error in determination" (i.E. NoSuchFileException)
  • utilizing SafeDirectoryStreams (providing native filesystem support in NIO) for recursive directory deletion
  • avoid NIO pitfall when deleting dead symbolic links

This PR was withdrawn a while ago. Reopen if needed.