/** * Write out, with any properties changes, but nothing else */ public void write(File newFile) throws IOException { try (POIFSFileSystem fs = POIFSFileSystem.create(newFile)) { write(fs); fs.writeFilesystem(); } } /**
/** * Method write - write out this workbook to a new {@link File}. Constructs * a new POI POIFSFileSystem, passes in the workbook binary representation and * writes it out. If the file exists, it will be replaced, otherwise a new one * will be created. * * Note that you cannot write to the currently open File using this method. * If you opened your Workbook from a File, you <i>must</i> use the {@link #write()} * method instead! * * @param newFile The new File you wish to write the XLS to * * @exception IOException if anything can't be written. * @see org.apache.poi.poifs.filesystem.POIFSFileSystem */ @Override public void write(File newFile) throws IOException { try (POIFSFileSystem fs = POIFSFileSystem.create(newFile)) { write(fs); fs.writeFilesystem(); } }
/** * Write out, with any properties changes, but nothing else */ public void write(File newFile) throws IOException { try (POIFSFileSystem fs = POIFSFileSystem.create(newFile)) { write(fs); fs.writeFilesystem(); } } /**
/** * Writes out the word file that is represented by an instance of this class. * * If the {@link File} exists, it will be replaced, otherwise a new one * will be created * * @param newFile The File to write to. * @throws IOException If there is an unexpected IOException from writing * to the File. * * @since 3.15 beta 3 */ @Override public void write(File newFile) throws IOException { POIFSFileSystem pfs = POIFSFileSystem.create(newFile); write(pfs, true); pfs.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 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(); } }
/** * Method write - write out this workbook to a new {@link File}. Constructs * a new POI POIFSFileSystem, passes in the workbook binary representation and * writes it out. If the file exists, it will be replaced, otherwise a new one * will be created. * * Note that you cannot write to the currently open File using this method. * If you opened your Workbook from a File, you <i>must</i> use the {@link #write()} * method instead! * * @param newFile The new File you wish to write the XLS to * * @exception IOException if anything can't be written. * @see org.apache.poi.poifs.filesystem.POIFSFileSystem */ @Override public void write(File newFile) throws IOException { try (POIFSFileSystem fs = POIFSFileSystem.create(newFile)) { write(fs); fs.writeFilesystem(); } }