public class POIServiceImpl extends AbstractService implements POIService
Modifier and Type | Field and Description |
---|---|
private Vector<String> |
filePath |
private Hashtable<String,DocumentEntry> |
files |
private Hashtable<String,Integer> |
fileSizes |
private POIFSFileSystem |
fileSystem |
private static int |
MAX_BLOCK_SIZE |
private DirectoryEntry |
root |
private RandomAccessInputStream |
stream |
Constructor and Description |
---|
POIServiceImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the current POI file system.
|
byte[] |
getDocumentBytes(String file)
Retrieve all of the raw bytes that correspond to the given file name.
|
byte[] |
getDocumentBytes(String file,
int length)
Retrieve at most 'length' bytes that correspond to the given file name.
|
Vector<String> |
getDocumentList()
Retrieve a list of all files in the current POI file system.
|
RandomAccessInputStream |
getDocumentStream(String file)
Retrieve a RandomAccessInputStream corresponding to the given file name.
|
int |
getFileSize(String file)
Retrieve the total number of bytes in the given file.
|
InputStream |
getInputStream(String file)
Retrieve an InputStream corresponding to the given file name.
|
void |
initialize(RandomAccessInputStream s)
Construct a new POI filesystem around the given stream.
|
void |
initialize(String file)
Construct a new POI filesystem around the given file.
|
private void |
parseFile(DirectoryEntry r) |
checkClassDependency
private static final int MAX_BLOCK_SIZE
private POIFSFileSystem fileSystem
private DirectoryEntry root
private RandomAccessInputStream stream
private Hashtable<String,DocumentEntry> files
public void initialize(String file) throws IOException
POIService
initialize
in interface POIService
IOException
- if an error occurred when opening the file.public void initialize(RandomAccessInputStream s) throws IOException
POIService
initialize
in interface POIService
IOException
- if an error occurred when reading from the stream.public InputStream getInputStream(String file) throws IOException
POIService
getInputStream
in interface POIService
file
- The name of the embedded file for which to
retrieve an InputStream.IOException
- if an error occurred when reading the filepublic RandomAccessInputStream getDocumentStream(String file) throws IOException
POIService
getDocumentStream
in interface POIService
file
- The name of the embedded file for which to
retrieve a RandomAccessInputStream.IOException
- if an error occurred when reading the filepublic byte[] getDocumentBytes(String file) throws IOException
POIService
getDocumentBytes
in interface POIService
file
- The name of the embedded file for which to retrieve bytes.IOException
- if an error occurred when reading the filepublic byte[] getDocumentBytes(String file, int length) throws IOException
POIService
getDocumentBytes
in interface POIService
file
- The name of the embedded file for which to retrieve bytes.IOException
- if an error occurred when reading the filepublic int getFileSize(String file)
POIService
getFileSize
in interface POIService
file
- The name of the embedded file.public Vector<String> getDocumentList()
POIService
getDocumentList
in interface POIService
public void close() throws IOException
POIService
close
in interface POIService
IOException
private void parseFile(DirectoryEntry r) throws IOException
IOException
Copyright © 2015 Open Microscopy Environment