public class FileImportInputStream extends ImportInputStream
ImportInputStream
class which
reads from a file on the BASE file system.Modifier and Type | Field and Description |
---|---|
private java.lang.String |
charset |
private File |
file |
Constructor and Description |
---|
FileImportInputStream(File file,
long offset,
java.lang.String charset)
Create a new import stream that reads data from
a file in the BASE filesystem.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCharacterSet()
Calls
File.getCharacterSet() , unless a character set
was specified in the constructor. |
java.lang.String |
getFilename()
Calls
CommonItem.getName() . |
long |
getLength()
Calls
File.getSize() to get the file size. |
java.lang.String |
getMimeType()
Calls
File.getMimeType() . |
private final File file
private final java.lang.String charset
public FileImportInputStream(File file, long offset, java.lang.String charset)
file
- The file to read fromoffset
- The offset (in bytes) to start reading fromcharset
- The character set to use when reading the file,
or null to use File.getCharacterSet()
.public long getLength()
File.getSize()
to get the file size.getLength
in class ImportInputStream
public java.lang.String getMimeType()
File.getMimeType()
.getMimeType
in class ImportInputStream
public java.lang.String getCharacterSet()
File.getCharacterSet()
, unless a character set
was specified in the constructor.getCharacterSet
in class ImportInputStream
Charset.forName(String)
public java.lang.String getFilename()
CommonItem.getName()
.getFilename
in class ImportInputStream