Class HPath


  • public final class HPath
    extends Object
    • Method Detail

      • getExtension

        public static String getExtension​(Path path)
        Get the file extension.
        Parameters:
        path - The path to the file to get the extension of.
        Returns:
        The extension, including the period.
      • isEmpty

        public static boolean isEmpty​(Path path)
        Test if the specified path is empty. An empty path is one with a single name, whose string value is empty (has zero characters). This is used to represent the default directory in a file system.
        Parameters:
        path - The path to test.
        Returns:
        true if this path is empty.
      • resolveFS

        public static Path resolveFS​(Path base,
                                     Path path)
        Resolve the path against the base after ensuring they're from the same filesystem.
        Parameters:
        base - The base path.
        path - The path to resolve against the base.
        Returns:
        The resolved path.
        See Also:
        Path.resolve(Path), ensureFS(FileSystem, Path)
      • ensureFS

        public static Path ensureFS​(FileSystem fileSystem,
                                    Path path)
        Return a path in the specified filesystem which is equivalent to path. Maybe return path if it is already in the appropriate fileSystem.
        Parameters:
        fileSystem - The target filesystem.
        path - The path.
        Returns:
        A path with all the same components as path in the file system fileSystem.