public ArchiveManifest copy(ArchiveManifest mf) { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); mf.write(out); InputStream in = new ByteArrayInputStream(out.toByteArray()); return new ArchiveManifestImpl(in); } catch (IOException iox) { //This should almost never happen, unless there is an issure with memory allocation throw new ArchiveRuntimeException(CommonArchiveResourceHandler.IOException_occurred_while_EXC_, iox); // = "IOException occurred while copying manifest" } }
/** * @see com.ibm.etools.archive.SaveStrategy */ public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException { try { OutputStream out = getUriConverter().createOutputStream(URI.createURI(J2EEConstants.MANIFEST_URI)); aManifest.write(out); out.close(); } catch (IOException iox) { throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox); } }
/** * @see com.ibm.etools.archive.SaveStrategy */ public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException { try { ZipEntry entry = new ZipEntry(J2EEConstants.MANIFEST_URI); getZipOutputStream().putNextEntry(entry); aManifest.write(getZipOutputStream()); getZipOutputStream().closeEntry(); } catch (IOException iox) { throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox); } }
manifest.write(outputStream); outputStream.flush(); } finally {
/** * @see com.ibm.etools.archive.SaveStrategy */ public void save(org.eclipse.jst.j2ee.commonarchivecore.internal.helpers.ArchiveManifest aManifest) throws SaveFailureException { try { OutputStream out = getUriConverter().createOutputStream(URI.createURI(J2EEConstants.MANIFEST_URI)); aManifest.write(out); out.close(); if (getArchive().getOptions().isReadOnly()) setTimestampAfterSaving(J2EEConstants.MANIFEST_URI); } catch (IOException iox) { throw new SaveFailureException(J2EEConstants.MANIFEST_URI, iox); } }
public void save(ArchiveManifest aManifest) throws SaveFailureException { IVirtualFolder rootFolder = vComponent.getRootFolder(); IVirtualFile vFile = rootFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); IFile iFile = vFile.getUnderlyingFile(); validateEdit(iFile); OutputStream out = new WorkbenchByteArrayOutputStream(iFile); try { aManifest.write(out); } catch (IOException e) { Logger.getLogger().logError(e); } finally { try { out.close(); } catch (IOException e) { Logger.getLogger().logError(e); } } }
public void save(ArchiveManifest aManifest) throws SaveFailureException { IVirtualFolder rootFolder = vComponent.getRootFolder(); IVirtualFile vFile = rootFolder.getFile(new Path(J2EEConstants.MANIFEST_URI)); IFile iFile = vFile.getUnderlyingFile(); validateEdit(iFile); OutputStream out = new WorkbenchByteArrayOutputStream(iFile); try { aManifest.write(out); } catch (IOException e) { Logger.getLogger().logError(e); } finally { try { out.close(); } catch (IOException e) { Logger.getLogger().logError(e); } } }