public Archive addCopy(Archive anArchive) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException { if (anArchive.isModuleFile()) return addCopy((ModuleFile) anArchive); Archive copy = super.addCopy(anArchive); copy.initializeClassLoader(); return copy; }
/** * @see Command */ public void execute() { results = new ArrayList(); validatateXml(); if (isValidateNested()) { List archives = archive.getArchiveFiles(); for (int i = 0; i < archives.size(); i++) { Archive a = (Archive) archives.get(i); if (!a.isModuleFile()) continue; ModuleFile m = (ModuleFile) a; ValidateXmlCommand cmd = new ValidateXmlCommand(m); cmd.execute(); results.addAll(cmd.getResult()); } } }
/** * For the given object in the deployment descriptor, return the owning module file; for * example, retrieve the EJBJarFile that owns the EJBJar. This works even for alts */ public static ModuleFile getModuleFile(EObject ddObject) { Resource res = ddObject.eResource(); if (res == null) return null; Archive archive = getArchive(res); if (archive == null || !archive.isModuleFile()) return null; if (!(res instanceof XMLResource)) return null; XMLResource xmlRes = (XMLResource) res; if (xmlRes.isAlt()) return getModuleFileUsingAltDD((EARFile) archive, res); return (ModuleFile) archive; }
if (anArchive.isModuleFile()) return !anArchive.getOptions().isReadOnly(); else if (anArchive.getOptions().isSaveLibrariesAsFiles() && anArchive.getLoadingContainer() != null) {
continue; if (f != null && f.isArchive() && anArchive.isModuleFile()) { Archive archive = (Archive) f; ModuleFile m = (ModuleFile) anArchive;
protected boolean shouldSave(File aFile) { boolean loaded = isLoadedResourceOrManifest(aFile); if (loaded) { Resource res = archive.getLoadStrategy().getExistingMofResource(aFile.getURI()); if (res == null) return false; //must be manifest return !shouldSave(res); } if (getArchive().isModuleFile()) { ModuleFile m = (ModuleFile) getArchive(); if (m.getExportStrategy() != null && m.getExportStrategy().hasSaved(aFile.getURI())) return false; } return shouldSave(aFile.getURI()); }
if (source.isModuleFile()) copyImportStrategyIfNecessary((ModuleFile) source, (ModuleFile) copy);
/** * @see com.ibm.etools.archive.ArchiveTypeDiscriminator */ public Archive convert(Archive anArchive) throws OpenFailureException { Archive destination = createConvertedArchive(); //turn of notifications destination.eSetDeliver(false); destination.eSetDeliver(false); //Copy the relevant attributes destination.setURI(anArchive.getURI()); destination.setOriginalURI(anArchive.getURI()); destination.setSize(anArchive.getSize()); destination.setLastModified(anArchive.getLastModified()); destination.setLoadStrategy(anArchive.getLoadStrategy()); destination.setOptions(anArchive.getOptions()); destination.setExtraClasspath(anArchive.getExtraClasspath()); if (destination.isModuleFile()) { ImportStrategy importStrategy = createImportStrategy(anArchive, destination); ((ModuleFile) destination).setImportStrategy(importStrategy); } //turn notifications back on destination.eSetDeliver(true); destination.eSetDeliver(true); return destination; }