/** * utility method for getting contents of directory and * sub directories */ private void getListOfFiles(File directory, List<String> files, List embeddedArchives) { getListOfFiles(directory, files, embeddedArchives, logger); }
/** * @return an @see java.util.Enumeration of entries in this abstract * archive */ @Override public Enumeration entries() { final List namesList = new ArrayList(); getListOfFiles(archive, namesList, null); return Collections.enumeration(namesList); }
/** * Returns an enumeration of the module file entries with the * specified prefix. All elements in the enumeration are of * type String. Each String represents a file name relative * to the root of the module. * * @param prefix the prefix of entries to be included * @return an enumeration of the archive file entries. */ @Override public Enumeration<String> entries(String prefix) { prefix = prefix.replace('/', File.separatorChar); File file = new File(archive, prefix); List<String> namesList = new ArrayList<String>(); getListOfFiles(file, namesList, null); return Collections.enumeration(namesList); }
/** * @return an @see java.util.Enumeration of entries in this abstract * archive, providing the list of embedded archive to not count their * entries as part of this archive */ public Enumeration entries(Enumeration embeddedArchives) { List<String> nameList = new ArrayList<String>(); List massagedNames = new ArrayList(); while (embeddedArchives.hasMoreElements()) { String subArchiveName = (String) embeddedArchives.nextElement(); massagedNames.add(FileUtils.makeFriendlyFilenameExtension(subArchiveName)); } getListOfFiles(archive, nameList, massagedNames); return Collections.enumeration(nameList); }
getListOfFiles(aList, files, null, logger); getListOfFiles(aList, files, null, logger);