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