Class SafePathFactory


public final class SafePathFactory extends SafeFileOperationFactory<Path>
Factory class for creating Path instances. This should be the only way to create a Path object.
Since:
12.0.0
  • Method Details

    • of

      public static SafePathFactory of(String first, String... more)
      Creates a SafePathFactory instance with the given path.
      Parameters:
      first - same as in Path.of(String, String...)
      more - same as in Path.of(String, String...)
      Returns:
      a SafePathFactory instance
    • lenient

      public static SafePathFactory lenient(String first, String... more)
    • toPath

      protected String toPath()
      Description copied from class: SafeFileOperationFactory
      Returns the path to the file. This should be the file to which the file operator give the access. e.g. for java.io.File it would be java.io.File#getPath()
      Specified by:
      toPath in class SafeFileOperationFactory<Path>
      Returns:
      the path as a string
    • get

      protected Path get()
      Specified by:
      get in class SafeFileOperationFactory<Path>