Examples of writeFilesystem()


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

         * <li><p>Write the POI filesystem to a (temporary) file <em>doc3</em>
         * and close the latter. */
        final File doc3 = File.createTempFile("POI_HPSF_Test.", ".tmp");
        doc3.deleteOnExit();
        out = new FileOutputStream(doc3);
        poifs.writeFilesystem(out);
        out.close();
   
        /*
         * Open <em>doc3</em> for reading and check summary information
         * and document summary information. All properties removed before must not
View Full Code Here

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

    POIFSFileSystem fs = new POIFSFileSystem();
    DirectoryEntry dir = fs.getRoot();
    dir.createDocument("Foo", new ByteArrayInputStream(new byte[] { }));
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    fs.writeFilesystem(out);
    new POIFSFileSystem(new ByteArrayInputStream(out.toByteArray()));
  }

  public void testSingleEmptyDocumentEvent() throws IOException {
    POIFSFileSystem fs = new POIFSFileSystem();
View Full Code Here

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

        System.out.println("written");
      }
    });
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    fs.writeFilesystem(out);
    new POIFSFileSystem(new ByteArrayInputStream(out.toByteArray()));
  }

  public void testEmptyDocumentWithFriend() throws IOException {
    POIFSFileSystem fs = new POIFSFileSystem();
View Full Code Here

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

    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()));
  }

  public void testEmptyDocumentEventWithFriend() throws IOException {
    POIFSFileSystem fs = new POIFSFileSystem();
View Full Code Here

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

      public void processPOIFSWriterEvent(POIFSWriterEvent event) {
      }
    });
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    fs.writeFilesystem(out);
    new POIFSFileSystem(new ByteArrayInputStream(out.toByteArray()));
  }
}
View Full Code Here

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

        if (preserveNodes) {
            List excepts = new ArrayList(1);
            excepts.add("Workbook");
            copyNodes(this.poifs,fs,excepts);
        }
        fs.writeFilesystem(stream);
        //poifs.writeFilesystem(stream);
    }

    /**
     * Method getBytes - get the bytes of just the HSSF portions of the XLS file.
View Full Code Here

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

         * system. It is given the default name most (if not all) summary
         * information property sets have. */
        poiFs.createDocument(is, SummaryInformation.DEFAULT_STREAM_NAME);

        /* Write the whole POI file system to a disk file. */
        poiFs.writeFilesystem(new FileOutputStream(fileName));
    }

}
View Full Code Here

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

                    TikaInputStream tin = (TikaInputStream) inputStream;

                    if (tin.getOpenContainer() != null && tin.getOpenContainer() instanceof DirectoryEntry) {
                        POIFSFileSystem fs = new POIFSFileSystem();
                        copy((DirectoryEntry) tin.getOpenContainer(), fs.getRoot());
                        fs.writeFilesystem(os);
                    } else {
                        IOUtils.copy(inputStream, os);
                    }
                } else {
                    IOUtils.copy(inputStream, os);
View Full Code Here

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

          if (tin.getOpenContainer()!=null && tin.getOpenContainer() instanceof DirectoryEntry) {
            POIFSFileSystem fs = new POIFSFileSystem();
            copy((DirectoryEntry) tin.getOpenContainer(), fs.getRoot());
            ByteArrayOutputStream bos2 = new ByteArrayOutputStream();
            fs.writeFilesystem(bos2);
            bos2.close();

            zout.put(finalName, bos2.toByteArray());
          }
        }
View Full Code Here

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

    {
        byte[] bytes = getBytes();
        POIFSFileSystem fs = new POIFSFileSystem();

        fs.createDocument(new ByteArrayInputStream(bytes), "Workbook");
        fs.writeFilesystem(stream);
    }

    /**
     * Method getBytes - get the bytes of just the HSSF portions of the XLS file.
     * Use this to construct a POI POIFSFileSystem yourself.
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.