Examples of writeFilesystem()


Examples of org.apache.poi.poifs.filesystem.NPOIFSFileSystem.writeFilesystem()

        dsi.write(dir, DocumentSummaryInformation.DEFAULT_STREAM_NAME);

        /* Write the POI filesystem back to the original file. Please note that
         * in production code you should take care when write directly to the
         * origin, to make sure you don't loose things on error */
        poifs.writeFilesystem();
        poifs.close();
    }
}
View Full Code Here

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

        new ByteArrayInputStream(pict.toByteArray()), "Pictures"
    );
  }

  // Send the POIFSFileSystem object out to the underlying stream
  outFS.writeFilesystem(out);
   }


  /* ******************* adding methods follow ********************* */

 
View Full Code Here

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

            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.");
        }
        catch (Exception ex)
        {
View Full Code Here

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

        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: */
        final POIFSReader r = new POIFSReader();
        r.registerListener(new MyPOIFSReaderListener(),
View Full Code Here

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

        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: */
        final PropertySet[] psa = new PropertySet[1];
        final POIFSReader r = new POIFSReader();
View Full Code Here

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

        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];
        final POIFSReader r = new POIFSReader();
View Full Code Here

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

                psOut.write(psStream);
                psStream.close();
                final byte[] streamData = psStream.toByteArray();
                poiFs.createDocument(new ByteArrayInputStream(streamData),
                                     psf1[i].getName());
                poiFs.writeFilesystem(out);
            }
            out.close();


            /* Read the property set streams from the POI filesystem just
View Full Code Here

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

            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
            int codepage = Constants.CP_UNICODE;
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
                          new Integer(codepage));
            poiFs.createDocument(ps1.toInputStream(), "Test");
            poiFs.writeFilesystem(out);
            out.close();

            /* Read back: */
            final POIFile[] psf = Util.readPropertySets(copy);
            Assert.assertEquals(1, psf.length);
View Full Code Here

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

            s.setFormatID(SectionIDMap.DOCUMENT_SUMMARY_INFORMATION_ID[0]);
            int codepage = 12345;
            s.setProperty(PropertyIDMap.PID_CODEPAGE, Variant.VT_I2,
                          new Integer(codepage));
            poiFs.createDocument(ps1.toInputStream(), "Test");
            poiFs.writeFilesystem(out);
            out.close();
            fail("This testcase did not detect the invalid codepage value.");
        }
        catch (IllegalPropertySetDataException ex)
        {
View Full Code Here

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

        /* Write the POI filesystem to a (temporary) file <em>doc2</em>
         * and close the latter. */
        final File doc2 = File.createTempFile("POI_HPSF_Test.", ".tmp");
        doc2.deleteOnExit();
        OutputStream out = new FileOutputStream(doc2);
        poifs.writeFilesystem(out);
        out.close();

        /*
         * Open <em>doc2</em> for reading and check summary information and
         * document summary information. All properties written before must be
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.