Package manifold.io

Class FilePathComponents


  • public class FilePathComponents
    extends Object
    Represents the path to a file as a collection of directories.
    • Field Detail

      • root

        public final File root
        The File object representing root of the path (for example, / or C: or empty for relative paths).
      • segments

        public final List<File> segments
        The list of File objects representing every directory in the path to the file, up to an including the file itself.
    • Constructor Detail

      • FilePathComponents

        public FilePathComponents​(File root,
                                  List<File> segments)
    • Method Detail

      • rootName

        public String rootName()
        Returns a string representing the root for this file, or an empty string is this file name is relative.
      • isRooted

        public boolean isRooted()
        Returns true when the root is not empty.
      • size

        public int size()
        Returns the number of elements in the path to the file.
      • subPath

        public File subPath​(int beginIndex,
                            int endIndex)
        Returns a sub-path of the path, starting with the directory at the specified beginIndex and up to the specified endIndex.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object