/** * write all extra deployment descriptors (like cmp related and runtime dds) * * @out the abstract archive file to write to */ protected void writeExtraDeploymentDescriptors(WritableArchive out) throws IOException { writeRuntimeDeploymentDescriptors(out); writeWLRuntimeDeploymentDescriptors(out); }
/** * writes the deployment descriptors (standard and runtime) * to a JarFile using the right deployment descriptor path * * @param in the input archive * @param out the abstract archive file to write to */ public void writeDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException { // Standard DDs writeStandardDeploymentDescriptors(out); // Runtime DDs writeRuntimeDeploymentDescriptors(in, out); // Extension DDs writeExtensionDeploymentDescriptors(in, out); }
public void saveRuntimeInfo(File output) throws IOException { // if output file is null, we overwrite the current archive... File outputFile = output; if (outputFile == null) { outputFile = getTempFile(path); } // copy all entries from source to target except the // runtime descriptor file WritableArchive out = archiveFactory.createArchive(outputFile); ReadableArchive in = archiveFactory.openArchive(new File(path)); Vector skipFiles = new Vector(); skipFiles.add(getRuntimeDeploymentDescriptorPath()); copyInto(in, out, skipFiles); in.close(); // now save the runtime deployment descriptor... OutputStream os = out.putNextEntry(getRuntimeDeploymentDescriptorPath()); writeRuntimeDeploymentDescriptors(os); out.closeEntry(); out.close(); // if we overwrote the old archive, need to rename the tmp now if (output == null) { ReadableArchive finalArchive = archiveFactory.openArchive(new File(path)); finalArchive.delete(); ReadableArchive tmpArchive = archiveFactory.openArchive(outputFile); tmpArchive.renameTo(path); } }
subArchivist.writeRuntimeDeploymentDescriptors(os); out.closeEntry();