Class FileInputSource


  • public class FileInputSource
    extends VaultInputSource
    Implements a input source that is based on a File. The path of the file is used as systemId.

    Currently only getByteStream() is implemented.

    • Constructor Summary

      Constructors 
      Constructor Description
      FileInputSource​(java.io.File file)
      Creates a new input source that is based on a file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void discard()
      deletes the underlying file
      java.io.InputStream getByteStream()
      long getContentLength()
      Returns the content length of the underlying file.
      long getLastModified()
      Returns the last modified date of the underlying file.
      void setLineSeparator​(byte[] lineSeparator)
      Sets the linefeed to use.
      • Methods inherited from class org.xml.sax.InputSource

        getCharacterStream, getEncoding, getPublicId, getSystemId, isEmpty, setByteStream, setCharacterStream, setEncoding, setPublicId, setSystemId
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileInputSource

        public FileInputSource​(java.io.File file)
        Creates a new input source that is based on a file.
        Parameters:
        file - the file.
    • Method Detail

      • setLineSeparator

        public void setLineSeparator​(byte[] lineSeparator)
        Sets the linefeed to use. If this is not null the output stream of the file is wrapped by a LineInputStream with that given line feed
        Parameters:
        lineSeparator - the linefeed for text
      • getByteStream

        public java.io.InputStream getByteStream()
        Overrides:
        getByteStream in class org.xml.sax.InputSource
        Returns:
        a FileInputStream on the internal file.
      • getContentLength

        public long getContentLength()
        Returns the content length of the underlying file.
        Specified by:
        getContentLength in class VaultInputSource
        Returns:
        the content length of the underlying file.
      • getLastModified

        public long getLastModified()
        Returns the last modified date of the underlying file.
        Specified by:
        getLastModified in class VaultInputSource
        Returns:
        the last modified date of the underlying file.
      • discard

        public void discard()
        deletes the underlying file