/** * Return a filtered list on the files with just the instances of ReadOnlyDirectory */ public List getReadOnlyDirectories() { List filtered = new ArrayList(); List filesList = getFiles(); for (int i = 0; i < filesList.size(); i++) { File aFile = (File) filesList.get(i); if (aFile.isReadOnlyDirectory()) filtered.add(aFile); } return filtered; }
/** * Returns a flat list of all the files contained in this directory and subdirectories, with the * directories filtered out, as the list would appear in an archive */ public java.util.List getFilesRecursive() { List allFiles = new ArrayList(); List filesList = getFiles(); for (int i = 0; i < filesList.size(); i++) { File aFile = (File) filesList.get(i); if (aFile.isReadOnlyDirectory()) allFiles.addAll(((ReadOnlyDirectory) aFile).getFilesRecursive()); else allFiles.add(aFile); } return allFiles; }
/** * @see com.ibm.etools.commonarchive.WARFile */ public File addCopyLib(File aFile) throws DuplicateObjectException { if (aFile.isReadOnlyDirectory()) throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_lib_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyLib not supported for directories :" return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_LIB_URI); }
/** * @see com.ibm.etools.commonarchive.WARFile */ public File addCopyClass(File aFile) throws org.eclipse.jst.j2ee.commonarchivecore.internal.exception.DuplicateObjectException { if (aFile.isReadOnlyDirectory()) throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_class_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyClass not supported for directories :" return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_CLASSES_URI); }
/** * @see com.ibm.etools.commonarchive.WARFile */ public File addCopyClass(File aFile) throws DuplicateObjectException { if (aFile.isReadOnlyDirectory()) throw new IllegalArgumentException(CommonArchiveResourceHandler.getString(CommonArchiveResourceHandler.add_copy_class_dir_EXC_, (new Object[]{aFile.getURI()}))); // = "Method addCopyClass not supported for directories :" return addCopyFileAddingPrefix(aFile, ArchiveConstants.WEBAPP_CLASSES_URI); }
/** * @see com.ibm.etools.commonarchive.Archive Adds a copy of the parameter to this archive * @throws com.ibm.etools.archive.exception.DuplicateObjectException * if the archive already contains a file with the specified uri */ public File addCopy(File aFile) throws DuplicateObjectException { if (aFile.isReadOnlyDirectory()) { addCopy((ReadOnlyDirectory) aFile); return null; } checkAddValid(aFile); File copy = copy(aFile); getFiles().add(copy); return copy; }