Package org.apache.poi.poifs.property

Examples of org.apache.poi.poifs.property.DocumentProperty


        {
            rawBlocks[ j ] = new RawDataBlock(stream);
        }
        POIFSDocument    document  = new POIFSDocument("document", rawBlocks,
                                         2000);
        DocumentProperty property2 = document.getDocumentProperty();
        DirectoryNode    parent    = new DirectoryNode(property1, null, null);
        DocumentNode     node      = new DocumentNode(property2, parent);

        // verify we can retrieve the document
        assertEquals(property2.getDocument(), node.getDocument());

        // verify we can get the size
        assertEquals(property2.getSize(), node.getSize());

        // verify isDocumentEntry returns true
        assertTrue(node.isDocumentEntry());

        // verify isDirectoryEntry returns false
        assertTrue(!node.isDirectoryEntry());

        // verify getName behaves correctly
        assertEquals(property2.getName(), node.getName());

        // verify getParent behaves correctly
        assertEquals(parent, node.getParent());
    }
View Full Code Here


    public void testNonEmptyConstructor() throws IOException {
        DirectoryProperty property1 = new DirectoryProperty("parent");
        DirectoryProperty property2 = new DirectoryProperty("child1");

        property1.addChild(property2);
        property1.addChild(new DocumentProperty("child2", 2000));
        property2.addChild(new DocumentProperty("child3", 30000));
        DirectoryNode node  = new DirectoryNode(property1,
                                                new POIFSFileSystem(), null);

        // verify that getEntries behaves correctly
        int           count = 0;
View Full Code Here

    _marked_offset_count = 0;
    _document_size = document.getSize();
    _closed = false;
   
      DocumentNode doc = (DocumentNode)document;
    DocumentProperty property = (DocumentProperty)doc.getProperty();
    _document = new NPOIFSDocument(
          property,
          ((DirectoryNode)doc.getParent()).getNFileSystem()
    );
    _data = _document.getBlockIterator();
View Full Code Here

     * @exception IOException
     */
    DocumentEntry createDocument(final POIFSDocument document)
        throws IOException
    {
        DocumentProperty property = document.getDocumentProperty();
        DocumentNode     rval     = new DocumentNode(property, this);

        (( DirectoryProperty ) getProperty()).addChild(property);
        _ofilesystem.addDocument(document);
       
        _entries.add(rval);
        _byname.put(property.getName(), rval);
        return rval;
    }
View Full Code Here

     * @exception IOException
     */
    DocumentEntry createDocument(final NPOIFSDocument document)
        throws IOException
    {
        DocumentProperty property = document.getDocumentProperty();
        DocumentNode     rval     = new DocumentNode(property, this);

        (( DirectoryProperty ) getProperty()).addChild(property);
        _nfilesystem.addDocument(document);
       
        _entries.add(rval);
        _byname.put(property.getName(), rval);
        return rval;
    }
View Full Code Here

     */

    DocumentEntry createDocument(final POIFSDocument document)
        throws IOException
    {
        DocumentProperty property = document.getDocumentProperty();
        DocumentNode     rval     = new DocumentNode(property, this);

        (( DirectoryProperty ) getProperty()).addChild(property);
        _filesystem.addDocument(document);
        _entries.add(rval);
        _byname.put(property.getName(), rval);
        return rval;
    }
View Full Code Here

             POIFSConstants.LARGER_BIG_BLOCK_SIZE_DETAILS
       );
    }
   
    _big_store = new BigBlockStore(_bigBigBlockSize, convertRawBlocksToBigBlocks(blocks));
    _property = new DocumentProperty(name, _size);
    _small_store = new SmallBlockStore(_bigBigBlockSize, EMPTY_SMALL_BLOCK_ARRAY);
    _property.setDocument(this);
  }
View Full Code Here

    } else {
       _bigBigBlockSize = blocks[0].getBigBlockSize();
    }

    _big_store = new BigBlockStore(_bigBigBlockSize, EMPTY_BIG_BLOCK_ARRAY);
    _property = new DocumentProperty(name, _size);
    _small_store = new SmallBlockStore(_bigBigBlockSize, blocks);
    _property.setDocument(this);
  }
View Full Code Here

   * @param length the actual length of the POIFSDocument
   */
  public POIFSDocument(String name, POIFSBigBlockSize bigBlockSize, ListManagedBlock[] blocks, int length) throws IOException {
    _size = length;
    _bigBigBlockSize = bigBlockSize;
    _property = new DocumentProperty(name, _size);
    _property.setDocument(this);
    if (Property.isSmall(_size)) {
      _big_store = new BigBlockStore(bigBlockSize,EMPTY_BIG_BLOCK_ARRAY);
      _small_store = new SmallBlockStore(bigBlockSize,convertRawBlocksToSmallBlocks(blocks));
    } else {
View Full Code Here

      }
    }
    DocumentBlock[] bigBlocks = blocks.toArray(new DocumentBlock[blocks.size()]);

    _big_store = new BigBlockStore(bigBlockSize,bigBlocks);
    _property = new DocumentProperty(name, _size);
    _property.setDocument(this);
    if (_property.shouldUseSmallBlocks()) {
      _small_store = new SmallBlockStore(bigBlockSize,SmallDocumentBlock.convert(bigBlockSize,bigBlocks, _size));
      _big_store = new BigBlockStore(bigBlockSize,new DocumentBlock[0]);
    } else {
View Full Code Here

TOP

Related Classes of org.apache.poi.poifs.property.DocumentProperty

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.