Class POIServiceImpl

java.lang.Object
loci.common.services.AbstractService
loci.formats.services.POIServiceImpl
All Implemented Interfaces:
loci.common.services.Service, POIService

public class POIServiceImpl extends loci.common.services.AbstractService implements POIService
  • Field Details

    • MAX_BLOCK_SIZE

      private static final int MAX_BLOCK_SIZE
      See Also:
    • POI_MAGIC_BYTES

      public static final int POI_MAGIC_BYTES
      See Also:
    • fileSystem

      private loci.poi.poifs.filesystem.POIFSFileSystem fileSystem
    • root

      private loci.poi.poifs.filesystem.DirectoryEntry root
    • stream

      private loci.common.RandomAccessInputStream stream
    • filePath

      private Vector<String> filePath
    • fileSizes

      private Hashtable<String,Integer> fileSizes
    • files

      private Hashtable<String,loci.poi.poifs.filesystem.DocumentEntry> files
  • Constructor Details

    • POIServiceImpl

      public POIServiceImpl()
      Default constructor.
  • Method Details

    • initialize

      public void initialize(String file) throws IOException
      Description copied from interface: POIService
      Construct a new POI filesystem around the given file.
      Specified by:
      initialize in interface POIService
      Throws:
      IOException - if an error occurred when opening the file.
    • initialize

      public void initialize(loci.common.RandomAccessInputStream s) throws IOException
      Description copied from interface: POIService
      Construct a new POI filesystem around the given stream.
      Specified by:
      initialize in interface POIService
      Throws:
      IOException - if an error occurred when reading from the stream.
    • getInputStream

      public InputStream getInputStream(String file) throws IOException
      Description copied from interface: POIService
      Retrieve an InputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.
      Specified by:
      getInputStream in interface POIService
      Parameters:
      file - The name of the embedded file for which to retrieve an InputStream.
      Throws:
      IOException - if an error occurred when reading the file
    • getDocumentStream

      public loci.common.RandomAccessInputStream getDocumentStream(String file) throws IOException
      Description copied from interface: POIService
      Retrieve a RandomAccessInputStream corresponding to the given file name. Either of the 'initialize' methods must be called before this method.
      Specified by:
      getDocumentStream in interface POIService
      Parameters:
      file - The name of the embedded file for which to retrieve a RandomAccessInputStream.
      Throws:
      IOException - if an error occurred when reading the file
    • getDocumentBytes

      public byte[] getDocumentBytes(String file) throws IOException
      Description copied from interface: POIService
      Retrieve all of the raw bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.
      Specified by:
      getDocumentBytes in interface POIService
      Parameters:
      file - The name of the embedded file for which to retrieve bytes.
      Throws:
      IOException - if an error occurred when reading the file
    • getDocumentBytes

      public byte[] getDocumentBytes(String file, int length) throws IOException
      Description copied from interface: POIService
      Retrieve at most 'length' bytes that correspond to the given file name. Either of the 'initialize' methods must be called before this method.
      Specified by:
      getDocumentBytes in interface POIService
      Parameters:
      file - The name of the embedded file for which to retrieve bytes.
      Throws:
      IOException - if an error occurred when reading the file
    • getFileSize

      public int getFileSize(String file)
      Description copied from interface: POIService
      Retrieve the total number of bytes in the given file. Either of the 'initialize' methods must be called before this method.
      Specified by:
      getFileSize in interface POIService
      Parameters:
      file - The name of the embedded file.
    • getDocumentList

      public Vector<String> getDocumentList()
      Description copied from interface: POIService
      Retrieve a list of all files in the current POI file system.
      Specified by:
      getDocumentList in interface POIService
    • close

      public void close() throws IOException
      Description copied from interface: POIService
      Close the current POI file system.
      Specified by:
      close in interface POIService
      Throws:
      IOException
    • parseFile

      private void parseFile(loci.poi.poifs.filesystem.DirectoryEntry r) throws IOException
      Throws:
      IOException