Class Directory

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

public class Directory extends Object implements Comparable<Directory>
A directory that might be empty or might contain other directories or files.
  • Field Details

    • REQUIRED_ATTRIBUTES

      public static final Set<String> REQUIRED_ATTRIBUTES
    • VALID_ATTRIBUTES

      public static final Set<String> VALID_ATTRIBUTES
    • groupName

      public String groupName
    • lastModifiedTime

      public FileTime lastModifiedTime
    • mode

      public Integer mode
    • name

      public String name
    • userName

      public String userName
  • Constructor Details

  • Method Details

    • attributesValid

      public static String attributesValid(Map<String,Object> attributes)
      Determines if the attributes given can be used to construct a Directory.
      Parameters:
      attributes - The attributes.
      Returns:
      Null if the attributes are valid, an error message describing why they aren't valid.
    • fromAttributes

      public static Directory fromAttributes(Map<String,Object> attributes)
      Constructs a Directory from a Map of attributes.
      Parameters:
      attributes - The attributes.
      Returns:
      The Directory.
    • compareTo

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

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

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

      public String toString()
      Overrides:
      toString in class Object
    • withGroupName

      public Directory withGroupName(String groupName)
      Sets the groupName.
      Parameters:
      groupName - The groupName
      Returns:
      This.
    • withLastModifiedTime

      public Directory withLastModifiedTime(FileTime lastModifiedTime)
      Sets the lastModifiedTime.
      Parameters:
      lastModifiedTime - The lastModifiedTime
      Returns:
      This.
    • withMode

      public Directory withMode(Integer mode)
      Sets the mode.
      Parameters:
      mode - The mode
      Returns:
      This.
    • withName

      public Directory withName(String name)
      Sets the name.
      Parameters:
      name - The name.
      Returns:
      This.
    • withUserName

      public Directory withUserName(String userName)
      Sets the userName.
      Parameters:
      userName - The userName
      Returns:
      This.