Class DirectoryEntry


  • public class DirectoryEntry
    extends java.lang.Object
    Supplied during calls to DirectoryTraversal.traverse() as each entry is encountered.
    • Constructor Detail

      • DirectoryEntry

        public DirectoryEntry()
    • Method Detail

      • withPath

        public DirectoryEntry withPath​(java.lang.String path)
        Sets the absolute path of this entry
        Parameters:
        path - path
        Returns:
        this entry object
      • getPath

        public java.lang.String getPath()
        Returns:
        the absolute path of this entry
      • withRelativePath

        public DirectoryEntry withRelativePath​(java.lang.String relativePath)
        Sets the path relative to the current working directory
        Parameters:
        relativePath - relative path
        Returns:
        this entry object
      • getRelativePath

        public java.lang.String getRelativePath()
        Returns:
        the path relative to the current working directory
      • withIsDirectory

        public DirectoryEntry withIsDirectory​(boolean isDirectory)
        Sets the isDirectory flag, meaning this entry corresponds to a directory
        Parameters:
        isDirectory - isDirectory
        Returns:
        this entry object
      • isDirectory

        public boolean isDirectory()
        Returns:
        true if this entry corresponds to a directory
      • withIsSymLink

        public DirectoryEntry withIsSymLink​(boolean isSymLink)
        Sets the isSymLink flag, meaning this entry corresponds to a symbolic link
        Parameters:
        isSymLink - isSymLink
        Returns:
        this entry object
      • isSymLink

        public boolean isSymLink()
        Returns:
        true if this entry corresponds to a symbolic link.
      • withIsFile

        public DirectoryEntry withIsFile​(boolean isFile)
        Sets the isFile flag, meaning this entry corresponds to a file
        Parameters:
        isFile - isFile
        Returns:
        this entry object
      • isFile

        public boolean isFile()
        Returns:
        true if this entry corresponds to a file
      • withFileSize

        public DirectoryEntry withFileSize​(long fileSize)
        Sets the file size corresponding to this entry
        Parameters:
        fileSize - file size in bytes
        Returns:
        this entry object
      • getFileSize

        public long getFileSize()
        Returns:
        the size of the file