final POIFSDocumentPath path)
throws IOException
{
while (properties.hasNext())
{
Property property = ( Property ) properties.next();
String name = property.getName();
if (property.isDirectory())
{
POIFSDocumentPath new_path = new POIFSDocumentPath(path,
new String[]
{
name
});
processProperties(
small_blocks, big_blocks,
(( DirectoryProperty ) property).getChildren(), new_path);
}
else
{
int startBlock = property.getStartBlock();
Iterator listeners = registry.getListeners(path, name);
if (listeners.hasNext())
{
int size = property.getSize();
POIFSDocument document = null;
if (property.shouldUseSmallBlocks())
{
document =
new POIFSDocument(name, small_blocks
.fetchBlocks(startBlock, -1), size);
}
else
{
document =
new POIFSDocument(name, big_blocks
.fetchBlocks(startBlock, -1), size);
}
while (listeners.hasNext())
{
POIFSReaderListener listener =
( POIFSReaderListener ) listeners.next();
listener.processPOIFSReaderEvent(
new POIFSReaderEvent(
new DocumentInputStream(document), path,
name));
}
}
else
{
// consume the document's data and discard it
if (property.shouldUseSmallBlocks())
{
small_blocks.fetchBlocks(startBlock, -1);
}
else
{