/** * Copy source archivist to a target abstract archive. By default, * every entry in source archive will be copied to the target archive, * including the manifest of the source archive. * * @param source the source archive to copy from * @param target the target archive to copy to */ public void copyInto(ReadableArchive source, WritableArchive target) throws IOException { copyInto(source, target, null, true); }
/** * Copy source archivist to a target abstract archive. By default, * every entry in source archive will be copied to the target archive. * * @param source the source archive to copy from * @param target the target archive to copy to * @param overwriteManifest if true, the manifest in source archive * overwrites the one in target archive */ public void copyInto(ReadableArchive source, WritableArchive target, boolean overwriteManifest) throws IOException { copyInto(source, target, null, overwriteManifest); }
/** * Copy source archivist to a target abstract archive. By default, * every entry in source archive will be copied to the target archive. * * @param source the source archive to copy from * @param target the target archive to copy to * @param overwriteManifest if true, the manifest in source archive * overwrites the one in target archive */ public void copyInto(ReadableArchive source, WritableArchive target, boolean overwriteManifest) throws IOException { copyInto(source, target, null, overwriteManifest); }
/** * Copy source archivist to a target abstract archive. By default, the manifest * in source archive overwrites the one in target archive. * * @param source the source archive to copy from * @param target the target archive to copy to * @param entriesToSkip the entries that will be skipped by target archive */ public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip) throws IOException { copyInto(source, target, entriesToSkip, true); }
/** * Copy source archivist to a target abstract archive. By default, * every entry in source archive will be copied to the target archive, * including the manifest of the source archive. * * @param source the source archive to copy from * @param target the target archive to copy to */ public void copyInto(ReadableArchive source, WritableArchive target) throws IOException { copyInto(source, target, null, true); }
/** * Copy source archivist to a target abstract archive. By default, the manifest * in source archive overwrites the one in target archive. * * @param source the source archive to copy from * @param target the target archive to copy to * @param entriesToSkip the entries that will be skipped by target archive */ public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip) throws IOException { copyInto(source, target, entriesToSkip, true); }
/** * Copy this archivist to a new abstract archive * * @param target the new archive to use to copy our contents into */ public void copyInto(WritableArchive target) throws IOException { ReadableArchive source = archiveFactory.openArchive(new File(path)); copyInto(source, target); }
/** * Copy this archivist to a new abstract archive * * @param target the new archive to use to copy our contents into */ public void copyInto(WritableArchive target) throws IOException { ReadableArchive source = archiveFactory.openArchive(new File(path)); copyInto(source, target); }
WritableArchive subTarget = target.createSubArchive(aModule.getArchiveUri()); Archivist newArchivist = archivistFactory.get().getPrivateArchivistFor(aModule.getModuleType()); newArchivist.copyInto(subSource, subTarget, overwriteManifest); target.closeEntry(subTarget); String subModulePath = subSource.getURI().getSchemeSpecificPart(); super.copyInto(source, target, entriesAdded, overwriteManifest);
ReadableArchive subArchive = archiveFactory.openArchive(subTarget.getURI()); subSource.setParentArchive(subArchive); newArchivist.copyInto(subSource, subTarget, overwriteManifest); target.closeEntry(subTarget); String subModulePath = subSource.getURI().getSchemeSpecificPart(); subArchive.close(); super.copyInto(source, target, entriesAdded, overwriteManifest);
protected void handleDeploymentPlan(File deploymentPlan, Archivist archivist, ReadableArchive sourceArchive, ApplicationHolder holder) throws IOException { //Note in copying of deployment plan to the portable archive, //we should make sure the manifest in the deployment plan jar //file does not overwrite the one in the original archive if (deploymentPlan != null) { DeploymentPlanArchive dpa = new DeploymentPlanArchive(); dpa.setParentArchive(sourceArchive); dpa.open(deploymentPlan.toURI()); // need to revisit for ear case WritableArchive targetArchive = archiveFactory.createArchive( sourceArchive.getURI()); if (archivist instanceof ApplicationArchivist) { ((ApplicationArchivist)archivist).copyInto(holder.app, dpa, targetArchive, false); } else { archivist.copyInto(dpa, targetArchive, false); } } }
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); } }