/** * Copy this archivist to a new abstract archive * @param source the archive to copy from * @param target the new archive to use to copy our contents into */ public void copyInto(ReadableArchive source, WritableArchive target) throws IOException { try { Application a = readStandardDeploymentDescriptor(source); copyInto(a, source, target); } catch(SAXParseException spe) { DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.fileCopyFailure", spe); } }
/** * This method creates a top level Application object for an ear. * @param archive the archive for the application * @param directory whether the application is packaged as a directory */ public Application createApplication(ReadableArchive archive, boolean directory) throws IOException, SAXException { if (hasStandardDeploymentDescriptor(archive) ) { return readStandardDeploymentDescriptor(archive); } else { return getApplicationFromIntrospection(archive, directory); } }
private static void getListOfFiles( File directory, Vector<File> files, FilenameFilter filter) { File[] list = directory.listFiles(filter); for (int i = 0; i < list.length; i++) { if (!list[i].isDirectory()) { files.add(list[i]); } else { getListOfFiles(list[i], files, filter); } } }
public Application openWith(Application application, ReadableArchive archive) throws IOException, SAXException { setManifest(archive.getManifest()); setDescriptor(application); if (extension.supportsModuleType(getModuleType())) { Object o = extension.open(this, archive, descriptor); if (o instanceof RootDeploymentDescriptor) { if (!readModulesDescriptors(application, archive)) return null; readRuntimeDeploymentDescriptor(archive, application); validate(null);
new ArrayList<ModuleDescriptor>(); List<ModuleDescriptor> sortedModules = sortModules(app); Archivist newArchivist = archivistFactory.get().getArchivist(aModule.getModuleType()); newArchivist.initializeContext(this); newArchivist.setRuntimeXMLValidation(this.getRuntimeXMLValidation()); newArchivist.setRuntimeXMLValidationLevel( this.getRuntimeXMLValidationLevel()); newArchivist.setAnnotationProcessingRequested( annotationProcessingRequested); newArchivist.postOpen(descriptor, embeddedArchive); if (isHandlingRuntimeInfo()) { DOLUtils.readAlternativeRuntimeDescriptor(appArchive, embeddedArchive, newArchivist, descriptor, aModule.getAlternateDescriptor());
Archivist newArchivist = archivistFactory.get().getPrivateArchivistFor(aModule.getModuleType()); newArchivist.initializeContext(this); newArchivist.setRuntimeXMLValidation(this.getRuntimeXMLValidation()); newArchivist.setRuntimeXMLValidationLevel( this.getRuntimeXMLValidationLevel()); newArchivist.setAnnotationProcessingRequested( annotationProcessingRequested); newArchivist.postOpen(descriptor, embeddedArchive); if (isHandlingRuntimeInfo()) { is = appArchive.getEntry("sun-" + aModule.getAlternateDescriptor()); if (is!=null) {
archivist.initializeContext(this); archivist.setRuntimeXMLValidation( this.getRuntimeXMLValidation()); archivist.setRuntimeXMLValidationLevel( this.getRuntimeXMLValidationLevel()); ReadableArchive subArchive = archive.getSubArchive(md.getArchiveUri()); if (md.getAlternateDescriptor()!=null) {
File[] files = getEligibleEntries(new File(appRoot), directory); for (File subModule : files) { ReadableArchive subArchive = null; String uri = deriveArchiveUri(appRoot, subModule, directory); if ((!directory && name.endsWith(".war")) || (directory && try { if (detector.hasAnnotationInArchive(unknowns.get(i))) { String uri = deriveArchiveUri(appRoot, jarFile, directory);
if (isHandlingRuntimeInfo()) { os = out.putNextEntry("sun-" + aModule.getAlternateDescriptor()); subArchivist.writeRuntimeDeploymentDescriptors(os); subArchivist.setArchiveUri(internalJar.getURI().getSchemeSpecificPart()); } else { tmpFile = getTempFile(path); BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(tmpFile)); ArchivistUtils.copy(is, bos);
/** * Copy this archivist to a new abstract archive * @param a the deployment descriptor for an application * @param source the source archive * @param target the target archive */ public void copyInto(Application a, ReadableArchive source, WritableArchive target) throws IOException { copyInto(a, source, target, true); }
subArchivist.setArchiveUri(internalJar.getURI().getSchemeSpecificPart()); } else { tmpFile = getTempFile(path); bos = new BufferedOutputStream(new FileOutputStream(tmpFile)); ArchivistUtils.copy(is, bos);
public Application openWith(Application application, ReadableArchive archive) throws IOException, SAXParseException { setManifest(archive.getManifest()); setDescriptor(application); if (extension.supportsModuleType(getModuleType())) { Object o = extension.open(this, archive, descriptor); if (o instanceof RootDeploymentDescriptor) { if (!readModulesDescriptors(application, archive)) return null; readRuntimeDeploymentDescriptor(archive, application); validate(null);
archivist.initializeContext(this); archivist.setRuntimeXMLValidation( this.getRuntimeXMLValidation()); archivist.setRuntimeXMLValidationLevel( this.getRuntimeXMLValidationLevel()); InputStream is = null;
File[] files = getEligibleEntries(new File(appRoot), directory); for (File subModule : files) { ReadableArchive subArchive = null; String uri = deriveArchiveUri(appRoot, subModule, directory); if ((!directory && name.endsWith(".war")) || (directory && try { if (detector.hasAnnotationInArchive(unknowns.get(i))) { String uri = deriveArchiveUri(appRoot, jarFile, directory);
/** * Copy this archivist to a new abstract archive * @param a the deployment descriptor for an application * @param source the source archive * @param target the target archive */ public void copyInto(Application a, ReadableArchive source, WritableArchive target) throws IOException { copyInto(a, source, target, true); }
/** * This method creates a top level Application object for an ear. * @param archive the archive for the application * @param directory whether the application is packaged as a directory */ public Application createApplication(ReadableArchive archive, boolean directory) throws IOException, SAXParseException { if (hasStandardDeploymentDescriptor(archive) ) { return readStandardDeploymentDescriptor(archive); } else { return getApplicationFromIntrospection(archive, directory); } }
/** * Copy this archivist to a new abstract archive * @param source the archive to copy from * @param target the new archive to use to copy our contents into */ public void copyInto(ReadableArchive source, WritableArchive target) throws IOException { try { Application a = readStandardDeploymentDescriptor(source); copyInto(a, source, target); } catch(SAXException spe) { DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.deployment.backend.fileCopyFailure", spe); } }
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); } } }
private static void getListOfFiles( File directory, Vector<File> files, FilenameFilter filter) { File[] list = directory.listFiles(filter); if (list == null) { return; } for (int i = 0; i < list.length; i++) { if (!list[i].isDirectory()) { files.add(list[i]); } else { getListOfFiles(list[i], files, filter); } } }
private static File[] getEligibleEntries(File appRoot, boolean deploydir) { //For deploydir, all modules are exploded at the top of application root if (deploydir) { return appRoot.listFiles(new DirectoryIntrospectionFilter()); } //For archive deploy, recursively search the entire package Vector<File> files = new Vector<File>(); getListOfFiles(appRoot, files, new ArchiveIntrospectionFilter(appRoot.getAbsolutePath())); return files.toArray(new File[files.size()]); }