Class DocumentName.FSInfo

java.lang.Object
org.apache.rat.document.DocumentName.FSInfo
All Implemented Interfaces:
Comparable<DocumentName.FSInfo>
Enclosing class:
DocumentName

public static final class DocumentName.FSInfo extends Object implements Comparable<DocumentName.FSInfo>
The file system information needed to process document names.
  • Constructor Details

    • FSInfo

      public FSInfo(FileSystem fileSystem)
      Constructor. Extracts the necessary data from the file system.
      Parameters:
      fileSystem - the file system to extract data from.
  • Method Details

    • getDefault

      public static DocumentName.FSInfo getDefault()
      Gets the FSInfo for the default file system. If the System property FSInfo is set, the FSInfo stored there is used, otherwise the FileSystem returned from FileSystems.getDefault() is used.
      Returns:
      the FSInfo for the default file system.
    • toString

      public String toString()
      Gets the common name for the underlying file system.
      Overrides:
      toString in class Object
      Returns:
      the common file system name.
    • dirSeparator

      public String dirSeparator()
      Gets the directory separator.
      Returns:
      The directory separator.
    • isCaseSensitive

      public boolean isCaseSensitive()
      Gets the case-sensitivity flag.
      Returns:
      the case-sensitivity flag.
    • rootFor

      public Optional<String> rootFor(String name)
      Retrieves the root extracted from the name.
      Parameters:
      name - the name to extract the root from
      Returns:
      an optional containing the root or empty.
    • tokenize

      public String[] tokenize(String source)
      Tokenizes the string based on the directory separator of this DocumentName.
      Parameters:
      source - the source to tokenize.
      Returns:
      the array of tokenized strings.
    • normalize

      public String normalize(String pattern)
      Removes . and .. from filenames.
      Parameters:
      pattern - the file name pattern
      Returns:
      the normalized file name.
    • compareTo

      public int compareTo(DocumentName.FSInfo other)
      Specified by:
      compareTo in interface Comparable<DocumentName.FSInfo>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object