protected Archive getResolvedArchive(String mfValue, EARFile ear) { String aUri = ArchiveUtil.deriveEARRelativeURI(mfValue, this); if (aUri == null) return null; try { return (Archive) ear.getFile(aUri); } catch (FileNotFoundException ex) { return null; } catch (ClassCastException ex2) { return null; } }
public boolean hasDirectOrIndirectDependencyTo(IProject archiveProject) { ClasspathElement element = getClasspathElement(archiveProject); if (element == null) return false; Archive anArchive = null; if (element.isValid()) { try { anArchive = (Archive) getEARFile().getFile(element.getText()); } catch (FileNotFoundException e) { } } return anArchive != null && archive.hasClasspathVisibilityTo(anArchive); }
protected void initModuleFileFromEAR() { checkEARFile(); ModuleFile aFile = null; try { aFile = (ModuleFile) getEarFile().getFile(module.getUri()); } catch (FileNotFoundException ex) { //Ignore } catch (ClassCastException ex) { //Ignore } checkType(module, aFile); setModuleFile(aFile); }
public boolean hasDirectOrIndirectDependencyTo(String jarName) { ClasspathElement element = getClasspathElement(jarName); if (element == null) return false; Archive anArchive = null; if (element.isValid()) { try { anArchive = (Archive) getEARFile().getFile(element.getText()); } catch (FileNotFoundException e) { } } return anArchive != null && archive.hasClasspathVisibilityTo(anArchive); }
public static Archive getClientJAR(EJBJarFile file, EARFile earFile) { EJBJar jar = null; try { jar = file.getDeploymentDescriptor(); } catch (DeploymentDescriptorLoadException exc) { return null; } if (jar == null) return null; String clientJAR = jar.getEjbClientJar(); if (clientJAR == null || clientJAR.length() == 0) return null; String normalized = ArchiveUtil.deriveEARRelativeURI(clientJAR, file.getURI()); if (normalized != null) { try { File aFile = earFile.getFile(normalized); if (aFile.isArchive() && !aFile.isModuleFile()) return (Archive) aFile; } catch (FileNotFoundException nothingThere) { } } return null; // TODO - release the DD here to free up space }
protected void traverseClasspaths(List projectCpEntries, Set visited) { File aFile = null; try { aFile = getEARFile().getFile(getText()); } catch (FileNotFoundException notThere) { } if (aFile == null || !aFile.isArchive()) return; Archive depArchive = (Archive) aFile; String[] manifestCpEntries = depArchive.getManifest().getClassPathTokenized(); for (int i = 0; i < manifestCpEntries.length; i++) { String uri = ArchiveUtil.deriveEARRelativeURI(manifestCpEntries[i], depArchive); if (uri == null) continue; ClasspathElement other = parentSelection.getClasspathElement(uri); //If the other element is already selected, then // we don't need to add it again if (other == null || other.isSelected()) continue; IClasspathEntry[] cpEntries = other.newClasspathEntries(visited); for (int j = 0; j < cpEntries.length; j++) { if (!projectCpEntries.contains(cpEntries[j])) projectCpEntries.add(cpEntries[j]); } } }
protected Object getResourceInDependentJarInEAR(String name, Set visitedArchives, int type) { String[] classpath = archive.getManifest().getClassPathTokenized(); for (int i = 0; i < classpath.length; i++) { try { String uri = ArchiveUtil.deriveEARRelativeURI(classpath[i], archive); if (uri == null) continue; File jarFile = getEARFile().getFile(uri); if (jarFile.isArchive()) { Archive dep = (Archive) jarFile; switch (type) { case CLASS_TYPE : try { return ((ArchiveFileDynamicClassLoader) dep.getArchiveClassLoader()).loadClass(name, visitedArchives); } catch (ClassNotFoundException noDice) { continue; } case FILE_TYPE : try { return dep.getFile(name); } catch (FileNotFoundException noDice) { continue; } } } } catch (java.io.FileNotFoundException depJarNotInEAR) { } } return null; }
f = earFile.getFile(uri); } catch (java.io.FileNotFoundException ex) { invalidClassPathEntryWarning(cp[i], earFile.getURI(), anArchive);
if (jar.getEjbClientJar() != null) { String clientName = jar.getEjbClientJar(); ejbClientArchiveWrapper = new ArchiveWrapper((Archive) ((EARFile) commonArchive).getFile(clientName));