Klasse FileReaderFactory

java.lang.Object
edu.hm.hafner.analysis.ReaderFactory
edu.hm.hafner.analysis.FileReaderFactory

public class FileReaderFactory extends ReaderFactory
Provides a ReaderFactory that returns readers for a given file.
Autor:
Ullrich Hafner
  • Konstruktordetails

    • FileReaderFactory

      public FileReaderFactory(Path file, @CheckForNull Charset charset)
      Creates a new factory to read the specified file with a given charset.
      Parameter:
      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.
      Parameter:
      file - the file to open
  • Methodendetails

    • create

      @MustBeClosed public Reader create()
      Beschreibung aus Klasse kopiert: ReaderFactory
      Creates a new Reader for the file.
      Angegeben von:
      create in Klasse ReaderFactory
      Gibt zurück:
      a reader
    • getFileName

      public String getFileName()
      Returns the absolute path of the resource. The file name uses UNIX path separators.
      Angegeben von:
      getFileName in Klasse ReaderFactory
      Gibt zurück:
      the file name
    • getCharset

      public Charset getCharset()
      Beschreibung aus Klasse kopiert: ReaderFactory
      Returns the character set that is used to read the stream.
      Setzt außer Kraft:
      getCharset in Klasse ReaderFactory
      Gibt zurück:
      the character set