/** * Writes out the slideshow file the is represented by an instance * of this class. * <p>This will write out only the common OLE2 streams. If you require all * streams to be written out, use {@link #write(OutputStream, boolean)} * with <code>preserveNodes</code> set to <code>true</code>. * * @param out The OutputStream to write to. * @throws IOException If there is an unexpected IOException from * the passed in OutputStream */ @Override public void write(OutputStream out) throws IOException { // Write out, but only the common streams write(out, false); }
/** * Writes out the slideshow file the is represented by an instance * of this class. * <p>This will write out only the common OLE2 streams. If you require all * streams to be written out, use {@link #write(File, boolean)} * with <code>preserveNodes</code> set to <code>true</code>. * * @param newFile The File to write to. * @throws IOException If there is an unexpected IOException from writing to the File */ @Override public void write(File newFile) throws IOException { // Write out, but only the common streams write(newFile, false); }
/** * Writes out the slideshow file the is represented by an instance * of this class. * If you require all streams to be written out (eg Marcos, embeded * documents), then set <code>preserveNodes</code> set to <code>true</code> * * @param newFile The File to write to. * @param preserveNodes Should all OLE2 streams be written back out, or only the common ones? * @throws IOException If there is an unexpected IOException from writing to the File */ public void write(File newFile, boolean preserveNodes) throws IOException { // Get a new FileSystem to write into try (POIFSFileSystem outFS = POIFSFileSystem.create(newFile)) { // Write into the new FileSystem write(outFS, preserveNodes); // Send the POIFSFileSystem object out to the underlying stream outFS.writeFilesystem(); } }
/** * Writes out the slideshow file the is represented by an instance * of this class. * If you require all streams to be written out (eg Marcos, embeded * documents), then set <code>preserveNodes</code> set to <code>true</code> * * @param out The OutputStream to write to. * @param preserveNodes Should all OLE2 streams be written back out, or only the common ones? * @throws IOException If there is an unexpected IOException from * the passed in OutputStream */ public void write(OutputStream out, boolean preserveNodes) throws IOException { // Get a new FileSystem to write into try (POIFSFileSystem outFS = new POIFSFileSystem()) { // Write into the new FileSystem write(outFS, preserveNodes); // Send the POIFSFileSystem object out to the underlying stream outFS.writeFilesystem(out); } }
/** * Writes out the slideshow to the currently open file. * <p> * <p>This will fail (with an {@link IllegalStateException} if the * slideshow was opened read-only, opened from an {@link InputStream} * instead of a File, or if this is not the root document. For those cases, * you must use {@link #write(OutputStream)} or {@link #write(File)} to * write to a brand new document. * * @throws IOException thrown on errors writing to the file * @throws IllegalStateException if this isn't from a writable File * @since POI 3.15 beta 3 */ @Override public void write() throws IOException { validateInPlaceWritePossible(); // Write the PowerPoint streams to the current FileSystem // No need to do anything to other streams, already there! write(getDirectory().getFileSystem(), false); // Sync with the File on disk getDirectory().getFileSystem().writeFilesystem(); }
@Override public void write(OutputStream out) throws IOException { // check for text paragraph modifications for (HSLFSlide sl : getSlides()) { writeDirtyParagraphs(sl); } for (HSLFSlideMaster sl : getSlideMasters()) { boolean isDirty = false; for (List<HSLFTextParagraph> paras : sl.getTextParagraphs()) { for (HSLFTextParagraph p : paras) { isDirty |= p.isDirty(); } } if (isDirty) { for (TxMasterStyleAtom sa : sl.getTxMasterStyleAtoms()) { if (sa != null) { // not all master style atoms are set - index 3 is typically null sa.updateStyles(); } } } } _hslfSlideShow.write(out); }