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
-
public class FileInputSource extends VaultInputSource
Implements a input source that is based on aFile
. 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 filejava.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.
-
-
-
Method Detail
-
setLineSeparator
public void setLineSeparator(byte[] lineSeparator)
Sets the linefeed to use. If this is notnull
the output stream of the file is wrapped by aLineInputStream
with that given line feed- Parameters:
lineSeparator
- the linefeed for text
-
getByteStream
public java.io.InputStream getByteStream()
- Overrides:
getByteStream
in classorg.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 classVaultInputSource
- 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 classVaultInputSource
- Returns:
- the last modified date of the underlying file.
-
discard
public void discard()
deletes the underlying file
-
-