Example usage for org.apache.poi.poifs.property Property getName

List of usage examples for org.apache.poi.poifs.property Property getName

Introduction

In this page you can find the example usage for org.apache.poi.poifs.property Property getName.

Prototype

public String getName() 

Source Link

Document

Get the name of this property

Usage

From source file:tv.amwa.maj.io.aaf.AAFReader.java

License:Apache License

private void processProperties(final BlockList small_blocks, final BlockList big_blocks,
        final Iterator<Property> properties, final POIFSDocumentPath path) throws IOException {

    while (properties.hasNext()) {
        Property property = properties.next();
        String name = property.getName();

        if (property.isDirectory()) {

            POIFSDocumentPath new_path = new POIFSDocumentPath(path, new String[] { name });

            readerListener.processPOIFSReaderEvent(new AAFReaderEvent(null, path, property));

            processProperties(small_blocks, big_blocks, ((DirectoryProperty) property).getChildren(), new_path);

            readerListener.processDirectoryEnd();
        } else {//from  w  w  w  .  j  av  a 2  s .  com
            int startBlock = property.getStartBlock();

            if (readerListener != null) {
                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);
                }

                readerListener.processPOIFSReaderEvent(
                        new AAFReaderEvent(new DocumentInputStream(document), path, property));
            } else {

                // consume the document's data and discard it
                if (property.shouldUseSmallBlocks()) {
                    small_blocks.fetchBlocks(startBlock, -1);
                } else {
                    big_blocks.fetchBlocks(startBlock, -1);
                }
            }
        }
    }
}