org.apache.poi.hsmf.parsers
Class POIFSChunkParser

java.lang.Object
  extended by org.apache.poi.hsmf.parsers.POIFSChunkParser

public class POIFSChunkParser
extends java.lang.Object

Provides a HashMap with the ability to parse a PIOFS object and provide an 'easy to access' hashmap structure for the document chunks inside it.

Author:
Travis Ferguson

Constructor Summary
POIFSChunkParser(POIFSFileSystem fs)
          Constructor
 
Method Summary
 java.lang.Object getChunk(java.util.HashMap dirMap, java.lang.String entryName)
          Pull the chunk data that's stored in this object's hashmap out and return it as a HashMap.
 java.util.HashMap getDirectoryChunk(java.lang.String directoryName)
          Pull a directory/hashmap out of this hashmap and return it
 Chunk getDocumentNode(Chunk chunk)
          Pulls a Chunk out of this objects root Node tree.
 Chunk getDocumentNode(java.util.HashMap dirNode, Chunk chunk)
          Pulls a ByteArrayOutputStream from this objects HashMap, this can be used to read a byte array of the contents of the given chunk.
 POIFSFileSystem getFileSystem()
          Get a reference to the FileSystem object that this object is currently using.
 void reparseFileSystem()
          Reparse the FileSystem object, resetting all the chunks stored in this object
 void setFileSystem(POIFSFileSystem fs)
          Set the POIFileSystem object that this object is using.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POIFSChunkParser

public POIFSChunkParser(POIFSFileSystem fs)
                 throws java.io.IOException
Constructor

Parameters:
fs -
Throws:
java.io.IOException
Method Detail

setFileSystem

public void setFileSystem(POIFSFileSystem fs)
                   throws java.io.IOException
Set the POIFileSystem object that this object is using.

Parameters:
fs -
Throws:
java.io.IOException

getFileSystem

public POIFSFileSystem getFileSystem()
Get a reference to the FileSystem object that this object is currently using.

Returns:

reparseFileSystem

public void reparseFileSystem()
                       throws java.io.IOException
Reparse the FileSystem object, resetting all the chunks stored in this object

Throws:
java.io.IOException

getChunk

public java.lang.Object getChunk(java.util.HashMap dirMap,
                                 java.lang.String entryName)
Pull the chunk data that's stored in this object's hashmap out and return it as a HashMap.

Parameters:
entryName -
Returns:

getDirectoryChunk

public java.util.HashMap getDirectoryChunk(java.lang.String directoryName)
                                    throws DirectoryChunkNotFoundException
Pull a directory/hashmap out of this hashmap and return it

Parameters:
directoryName -
Returns:
HashMap containing the chunks stored in the named directoryChunk
Throws:
DirectoryChunkNotFoundException - This is thrown should the directoryMap HashMap on this object be null or for some reason the directory is not found, is equal to null, or is for some reason not a HashMap/aka Directory Node.

getDocumentNode

public Chunk getDocumentNode(java.util.HashMap dirNode,
                             Chunk chunk)
                      throws ChunkNotFoundException
Pulls a ByteArrayOutputStream from this objects HashMap, this can be used to read a byte array of the contents of the given chunk.

Parameters:
directoryMap, - chunk
Returns:
Throws:
ChunkNotFoundException

getDocumentNode

public Chunk getDocumentNode(Chunk chunk)
                      throws ChunkNotFoundException
Pulls a Chunk out of this objects root Node tree.

Parameters:
chunk -
Returns:
Throws:
ChunkNotFoundException


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.