Package edu.hm.hafner.analysis
Class FileReaderFactory
java.lang.Object
edu.hm.hafner.analysis.ReaderFactory
edu.hm.hafner.analysis.FileReaderFactory
Provides a
ReaderFactory that returns readers for a given file.- Author:
- Ullrich Hafner
-
Constructor Summary
ConstructorsConstructorDescriptionFileReaderFactory(Path file) Creates a new factory to read the specified file.FileReaderFactory(Path file, Charset charset) Creates a new factory to read the specified file with a given charset. -
Method Summary
Methods inherited from class edu.hm.hafner.analysis.ReaderFactory
parse, readDocument, readStream, readString
-
Constructor Details
-
FileReaderFactory
Creates a new factory to read the specified file with a given charset.- Parameters:
file- the file to opencharset- the charset to use when reading the file (ornullif the charset should be detected)
-
FileReaderFactory
Creates a new factory to read the specified file. The charset will be detected from xml header.- Parameters:
file- the file to open
-
-
Method Details
-
create
Description copied from class:ReaderFactoryCreates a newReaderfor the file.- Specified by:
createin classReaderFactory- Returns:
- a reader
-
getFileName
Returns the absolute path of the resource. The file name uses UNIX path separators.- Specified by:
getFileNamein classReaderFactory- Returns:
- the file name
-
getCharset
Description copied from class:ReaderFactoryReturns the character set that is used to read the stream.- Overrides:
getCharsetin classReaderFactory- Returns:
- the character set
-