Document Names

Rat must be able to distinguish files in multiple file systems; most notably Windows® and Linux®. In addition, we want Rat to produce reports that are comparable across the platforms. To achieve these goals the org.apache.rat.document.impl.DocumentName class was developed.

All documents in the Rat system have a base directory. Different UIs will set the base directory differently. For example:

When reporting a document Rat will report the path from the base directory to the file; the path relative to the base directory.

The DocumentName comprises:

The class DocumentName also provides a static value that identifies the case-sensitivity of the underlying operating system.

DocumentName also provides methods to:

Notes

  • DocumentName implements
    • equals(),
    • hashCode()
    • Comparable<DocumentName>.
  • Base directories within the system are identified with DocumentNames that have the name and baseName set to the same underlying file system value.