/** * Copy this archivist to a new abstract 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 * @param overwriteManifest if true, the manifest in source archive * overwrites the one in target archive */ public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip, boolean overwriteManifest) throws IOException { copyJarElements(source, target, entriesToSkip); if (overwriteManifest) { Manifest m = source.getManifest(); if (m != null) { OutputStream os = target.putNextEntry(JarFile.MANIFEST_NAME); m.write(os); target.closeEntry(); } } }
/** * Copy this archivist to a new abstract 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 * @param overwriteManifest if true, the manifest in source archive * overwrites the one in target archive */ public void copyInto(ReadableArchive source, WritableArchive target, Vector entriesToSkip, boolean overwriteManifest) throws IOException { copyJarElements(source, target, entriesToSkip); if (overwriteManifest) { Manifest m = source.getManifest(); if (m != null) { OutputStream os = target.putNextEntry(JarFile.MANIFEST_NAME); m.write(os); target.closeEntry(); } } }
/** * writes the content of an archive to a JarFile * * @param in input archive * @param out archive output stream to write to * @param entriesToSkip files to not write from the original archive */ protected void writeContents(ReadableArchive in, WritableArchive out, Vector entriesToSkip) throws IOException { // Copy original jarFile elements if (in != null && in.exists()) { if (entriesToSkip == null) { entriesToSkip = getListOfFilesToSkip(); } else { entriesToSkip.addAll(getListOfFilesToSkip()); } copyJarElements(in, out, entriesToSkip); } // now the deployment descriptors writeDeploymentDescriptors(out); // manifest file if (manifest != null) { OutputStream os = out.putNextEntry(JarFile.MANIFEST_NAME); manifest.write(new DataOutputStream(os)); out.closeEntry(); } }
/** * writes the content of an archive to a JarFile * * @param in input archive * @param out archive output stream to write to * @param entriesToSkip files to not write from the original archive */ protected void writeContents(ReadableArchive in, WritableArchive out, Vector entriesToSkip) throws IOException { // Copy original jarFile elements if (in != null && in.exists()) { if (entriesToSkip == null) { entriesToSkip = getListOfFilesToSkip(in); } else { entriesToSkip.addAll(getListOfFilesToSkip(in)); } copyJarElements(in, out, entriesToSkip); } // now the deployment descriptors writeDeploymentDescriptors(in, out); // manifest file if (manifest != null) { OutputStream os = out.putNextEntry(JarFile.MANIFEST_NAME); manifest.write(new DataOutputStream(os)); out.closeEntry(); } }