/** * Creates the correct type of entry enumeration, depending on whether the * current archive is nested or not and depending on whether the caller * requested top-level directory entries or all non-directory entries be returned * in the enumeration. * * @param uriToReadForEntries * @param topLevelDirectoriesOnly * @return * @throws FileNotFoundException * @throws IOException */ private EntryEnumeration createEntryEnumeration( final boolean topLevelDirectoriesOnly) throws FileNotFoundException, IOException { final JarEntrySource source = (parentArchive == null ? new ArchiveJarEntrySource(uri) : new SubarchiveJarEntrySource(parentArchive.jarFile, uri)); if (topLevelDirectoriesOnly) { return new TopLevelDirectoryEntryEnumeration(source); } else { return new NonDirectoryEntryEnumeration(source); } }