Class FileReaderFactory


  • public class FileReaderFactory
    extends ReaderFactory
    Provides a ReaderFactory that returns readers for a given file.
    Author:
    Ullrich Hafner
    • Constructor Detail

      • FileReaderFactory

        public FileReaderFactory​(Path file,
                                 @CheckForNull
                                 Charset charset)
        Creates a new factory to read the specified file with a given charset.
        Parameters:
        file - the file to open
        charset - the charset to use when reading the file (or null if the charset should be detected)
      • FileReaderFactory

        public FileReaderFactory​(Path file)
        Creates a new factory to read the specified file. The charset will be detected from xml header.
        Parameters:
        file - the file to open
    • Method Detail

      • getFileName

        public String getFileName()
        Returns the absolute path of the resource. The file name uses UNIX path separators.
        Specified by:
        getFileName in class ReaderFactory
        Returns:
        the file name
      • getCharset

        public Charset getCharset()
        Description copied from class: ReaderFactory
        Returns the character set that is used to read the stream.
        Overrides:
        getCharset in class ReaderFactory
        Returns:
        the character set