Package org.apache.jackrabbit.vault.util
Class FileInputSource
java.lang.Object
org.xml.sax.InputSource
org.apache.jackrabbit.vault.fs.api.VaultInputSource
org.apache.jackrabbit.vault.util.FileInputSource
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
ConstructorsConstructorDescriptionFileInputSource(File file) Creates a new input source that is based on a file. -
Method Summary
Modifier and TypeMethodDescriptionvoiddiscard()deletes the underlying filelongReturns the content length of the underlying file.longReturns the last modified date of the underlying file.voidsetLineSeparator(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
-
Constructor Details
-
FileInputSource
Creates a new input source that is based on a file.- Parameters:
file- the file.
-
-
Method Details
-
setLineSeparator
public void setLineSeparator(byte[] lineSeparator) Sets the linefeed to use. If this is notnullthe output stream of the file is wrapped by aLineInputStreamwith that given line feed- Parameters:
lineSeparator- the linefeed for text
-
getByteStream
- Overrides:
getByteStreamin classInputSource- Returns:
- a
FileInputStreamon the internal file.
-
getContentLength
public long getContentLength()Returns the content length of the underlying file.- Specified by:
getContentLengthin classVaultInputSource- Returns:
- the content length of the underlying file.
-
getLastModified
public long getLastModified()Returns the last modified date of the underlying file.- Specified by:
getLastModifiedin classVaultInputSource- Returns:
- the last modified date of the underlying file.
-
discard
public void discard()deletes the underlying file
-