Class FileInfo

java.lang.Object
org.savantbuild.io.FileInfo
All Implemented Interfaces:
Comparable<FileInfo>

public class FileInfo extends Object implements Comparable<FileInfo>
The information about a file that is collected from a FileSet. This includes the origin Path (which might be absolute or relative to the directory of a FileSet) and a relative path (to the FileSet directory). This might also include other file attributes that are part of the calculation including mode, ownership, etc.
  • Field Details

    • creationTime

      public FileTime creationTime
    • groupName

      public String groupName
    • lastAccessTime

      public FileTime lastAccessTime
    • lastModifiedTime

      public FileTime lastModifiedTime
    • origin

      public Path origin
    • permissions

      public Set<PosixFilePermission> permissions
    • relative

      public Path relative
    • size

      public Long size
    • userName

      public String userName
  • Constructor Details

    • FileInfo

      public FileInfo(Path origin, Path relative)
  • Method Details

    • compareTo

      public int compareTo(FileInfo o)
      Specified by:
      compareTo in interface Comparable<FileInfo>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toMode

      public int toMode()

      Converts the file permissions of this FileInfo to a POSIX bit mapped mode. The bit map looks like this:

         1_000_000_001_000_000
       

      The first bit is always set. The next three bits are the set UID bits, the next 3 bits are the set GID bits. The next three bits are the owner permissions (read, write, execute), then the group permissions and finally the user permissions.

      Returns:
      The POSIX mode bit map as an integer.