for (int i = 0; i < files.size(); i++) { File aFile = (File) files.get(i); if (aFile.getLoadingContainer() == anArchive) { Archive outermost = openedArchive; Container c = openedArchive.getContainer();
/** * Answer whether an element in the archive having the uri should be saved; the uri may be for a * file, a nested archive, or a loaded mof resource. For deployed jars, if the file came was * copied from the orignal jar file, always save */ public boolean shouldSave(java.lang.String uri, Archive anArchive) { File aFile = null; try { aFile = anArchive.getFile(uri); } catch (java.io.FileNotFoundException mustBeAResource) { //Ignore } if (aFile == null) return targetShouldSave(uri, anArchive); return aFile.getLoadingContainer() != anArchive || targetShouldSave(uri, anArchive); }
/** * @see com.ibm.etools.commonarchive.File */ public java.io.InputStream getInputStream() throws java.io.FileNotFoundException, java.io.IOException { if (getLoadingContainer() != null || getLoadStrategy() == null || getLoadStrategy().isDirectory()) return super.getInputStream(); //This archive was copied in; this operation is not supported for // module files if (isModuleFile() || !getOptions().isSaveLibrariesAsFiles()) throw new IOException("Undefined state of nested archive"); //$NON-NLS-1$ //We have to find the absolute path of the original archive from which // this was copied, //if it is known List list = getFiles(); String absolutePath = null; for (int i = 0; i < list.size(); i++) { File aFile = (File) list.get(i); if (aFile.isArchive()) continue; absolutePath = aFile.getLoadingContainer().getAbsolutePath(); } return new FileInputStream(absolutePath); }
aFile = (File) files.get(i); if (i == 0) { firstContainer = aFile.getLoadingContainer(); if (firstContainer.getLoadStrategy().isDirectory()) return true; lContainer = aFile.getLoadingContainer(); if (lContainer != firstContainer) return true;
if (manifestToCopy != null) { File copiedManifest = (File) getCopy(manifestToCopy); copiedManifest.setLoadingContainer(manifestToCopy.getLoadingContainer()); copy.addCopy(copiedManifest); File aFile = (File) files.get(i); File copiedFile = (File) getCopy(aFile); copiedFile.setLoadingContainer(aFile.getLoadingContainer()); if (aFile.isArchive()) finishNestedCopy((Archive) aFile, (Archive) copiedFile);