Package org.apache.rat.document
Class FileDocument
java.lang.Object
org.apache.rat.api.Document
org.apache.rat.document.FileDocument
- All Implemented Interfaces:
Comparable<Document>
Document wrapping a File object.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.rat.api.Document
Document.Type -
Field Summary
Fields inherited from class org.apache.rat.api.Document
name, nameMatcher -
Constructor Summary
ConstructorsConstructorDescriptionFileDocument(File file, DocumentNameMatcher nameMatcher)Creates a File document where the baseDir is the root directory.FileDocument(DocumentName basedir, File file, DocumentNameMatcher nameMatcher)Creates a File document. -
Method Summary
Modifier and TypeMethodDescriptiongetFile()Gets the file underlying this document.Streams the document's contents.booleanDetermines if this document is a directory type.Gets a sorted set of documents that are children of this document.Methods inherited from class org.apache.rat.api.Document
compareTo, equals, getMetaData, getName, getNameMatcher, hashCode, isIgnored, reader, toString
-
Constructor Details
-
FileDocument
Creates a File document.- Parameters:
basedir- the base directory for this document.file- the file to wrap.nameMatcher- the path matcher to filter files/directories with.
-
FileDocument
Creates a File document where the baseDir is the root directory.- Parameters:
file- the file to wrap.nameMatcher- the path matcher to filter files/directories with.
-
-
Method Details
-
isDirectory
public boolean isDirectory()Description copied from class:DocumentDetermines if this document is a directory type.- Specified by:
isDirectoryin classDocument- Returns:
trueif this is a directory.
-
listChildren
Description copied from class:DocumentGets a sorted set of documents that are children of this document.- Specified by:
listChildrenin classDocument- Returns:
- A sorted set of child Documents. May be empty.
-
inputStream
Description copied from class:DocumentStreams the document's contents.- Specified by:
inputStreamin classDocument- Returns:
- a non-null input stream of the document.
- Throws:
IOException- when stream could not be opened.
-
getFile
Gets the file underlying this document.- Returns:
- the file underlying this document.
-