/** * @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) { // jar file are not recursive return entries(); }
/** * @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) { // jar file are not recursive return entries(); }
/** * Returns the existence of the given entry name * The file name must be relative to the root of the module. * * @param name the file name relative to the root of the module. * @return the existence the given entry name. */ public boolean exists(String name) throws IOException { return (getEntry(name) != null); }
static String getName(URI uri) { String path = Util.getURIName(uri); int lastDot = path.lastIndexOf('.'); int endOfName = (lastDot != -1) ? lastDot : path.length(); String name = path.substring(0, endOfName); return name; }
/** * 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); } }
/** * Returns the existence of the given entry name * The file name must be relative to the root of the module. * * @param name the file name relative to the root of the module. * @return the existence the given entry name. */ public boolean exists(String name) throws IOException { return getJarEntry(name)!=null; }
/** * @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) { return entries(); }
/** Creates a new instance of MemoryMappedArchive */ public MemoryMappedArchive(InputStream is) throws IOException { read(is); }
/** * @return an Enumeration of entries not including entries * from the subarchives */ public Enumeration entries(java.util.Enumeration embeddedArchives) { return entries(); }
/** * Returns the existence of the given entry name * The file name must be relative to the root of the module. * * @param name the file name relative to the root of the module. * @return the existence the given entry name. */ public boolean exists(String name) throws IOException { return (getEntry(name) != null); }
/** Open an abstract archive * @param uri the path to the archive */ public void open(URI uri) throws IOException { this.uri = uri; jarFile = getJarFile(uri); }
/** * Finishes the initialization for the enumeration; MUST be invoked * from the subclass constructor after super(...). */ protected void completeInit() { nextMatchingEntry = skipToNextMatchingEntry(); }
private TopLevelDirectoryEntryEnumeration(final JarEntrySource jarEntrySource) throws FileNotFoundException, IOException { super(jarEntrySource); completeInit(); }
private NonDirectoryEntryEnumeration(final JarEntrySource jarEntrySource) throws IOException { super(jarEntrySource); completeInit(); }
CollectionWrappedEnumeration(final EnumerationFactory<T> factory) { this.factory = factory; e = factory.enumeration(); }
protected JarEntry getNextJarEntry() throws IOException { return jarEntrySource.getNextJarEntry(); }
private void closeNoRemove() { try { jarEntrySource.close(); } catch (IOException ex) { throw new RuntimeException(ex); } }
void close() { closeNoRemove(); entryEnumerations.remove(this); }
public Collection<String> getDirectories() throws IOException { return entries(true); }
@Override public Enumeration<String> entries() { return entries(false); }