@Override protected JarEntry skipToNextMatchingEntry() { JarEntry candidateNextEntry; try { /* * The next entry should be returned (and not skipped) if the entry is * not a directory entry and if it also not the manifest. */ while ((candidateNextEntry = getNextJarEntry()) != null) { final String candidateNextEntryName = candidateNextEntry.getName(); if ( ! candidateNextEntry.isDirectory() && ! candidateNextEntryName.equals(JarFile.MANIFEST_NAME) ) { break; } } return candidateNextEntry; } catch (IOException ex) { throw new RuntimeException(ex); } } }
/** * 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); } }
private NonDirectoryEntryEnumeration(final JarEntrySource jarEntrySource) throws IOException { super(jarEntrySource); completeInit(); }