Examples of createDocument()


Examples of org.apache.poi.poifs.filesystem.DirectoryEntry.createDocument()

  }

  public void testSingleEmptyDocumentEvent() throws IOException {
    POIFSFileSystem fs = new POIFSFileSystem();
    DirectoryEntry dir = fs.getRoot();
    dir.createDocument("Foo", 0, new POIFSWriterListener() {
      public void processPOIFSWriterEvent(POIFSWriterEvent event) {
        System.out.println("written");
      }
    });
   
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.DirectoryEntry.createDocument()

  }

  public void testEmptyDocumentWithFriend() throws IOException {
    POIFSFileSystem fs = new POIFSFileSystem();
    DirectoryEntry dir = fs.getRoot();
    dir.createDocument("Bar", new ByteArrayInputStream(new byte[] { 0 }));
    dir.createDocument("Foo", new ByteArrayInputStream(new byte[] { }));
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    fs.writeFilesystem(out);
    new POIFSFileSystem(new ByteArrayInputStream(out.toByteArray()));
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.DirectoryNode.createDocument()

    // Update the byte array with the latest data
    generateData();

    // Write out
    ByteArrayInputStream bais = new ByteArrayInputStream(data);
    dir.createDocument(path[path.length-1], bais);
  }

  /**
   * Called just before writing out, to trigger
   *  the data byte array to be updated with the
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

  // Update our cached copy of the bytes that make up the PPT stream
  _docstream = baos.toByteArray();

  // Write the PPT stream into the POIFS layer
  ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
  outFS.createDocument(bais,"PowerPoint Document");


  // Update and write out the Current User atom
  int oldLastUserEditAtomPos = (int)currentUser.getCurrentEditOffset();
  Integer newLastUserEditAtomPos = (Integer)oldToNewPositions.get(new Integer(oldLastUserEditAtomPos));
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

  if (_pictures != null) {
    ByteArrayOutputStream pict = new ByteArrayOutputStream();
    for (int i = 0; i < _pictures.length; i++ ) {
      _pictures[i].write(pict);
    }
    outFS.createDocument(
        new ByteArrayInputStream(pict.toByteArray()), "Pictures"
    );
  }

  // Send the POIFSFileSystem object out to the underlying stream
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

        {
            final ByteArrayOutputStream psStream = new ByteArrayOutputStream();
            ps.write(psStream);
            psStream.close();
            final byte[] streamData = psStream.toByteArray();
            poiFs.createDocument(new ByteArrayInputStream(streamData),
                                 SummaryInformation.DEFAULT_STREAM_NAME);
            poiFs.writeFilesystem(out);
            out.close();
            Assert.fail("Should have thrown a NoFormatIDException.");
        }
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

        final ByteArrayOutputStream psStream = new ByteArrayOutputStream();
        ps.write(psStream);
        psStream.close();
        final byte[] streamData = psStream.toByteArray();
        poiFs.createDocument(new ByteArrayInputStream(streamData),
                             SummaryInformation.DEFAULT_STREAM_NAME);
        poiFs.writeFilesystem(out);
        out.close();

        /* Read the POIFS: */
 
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

        p.setType(Variant.VT_LPWSTR);
        p.setValue(AUTHOR);
        si.setProperty(p);
        si.setProperty(PropertyIDMap.PID_TITLE, Variant.VT_LPSTR, TITLE);
   
        poiFs.createDocument(ps.toInputStream(),
                             SummaryInformation.DEFAULT_STREAM_NAME);
        poiFs.writeFilesystem(out);
        out.close();
   
        /* Read the POIFS: */
 
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

        final MutableSection s2 = new MutableSection();
        s2.setFormatID(formatID);
        s2.setProperty(2, SECTION2);
        ps.addSection(s2);

        poiFs.createDocument(ps.toInputStream(), STREAM_NAME);
        poiFs.writeFilesystem(out);
        out.close();

        /* Read the POIFS: */
        final PropertySet[] psa = new PropertySet[1];
View Full Code Here

Examples of org.apache.poi.poifs.filesystem.POIFSFileSystem.createDocument()

                final ByteArrayOutputStream psStream =
                    new ByteArrayOutputStream();
                psOut.write(psStream);
                psStream.close();
                final byte[] streamData = psStream.toByteArray();
                poiFs.createDocument(new ByteArrayInputStream(streamData),
                                     psf1[i].getName());
                poiFs.writeFilesystem(out);
            }
            out.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.