public boolean isDirectory(String name) { if (filter.accept(delegate, name)) { return delegate.isDirectory(name); } return false; }
private boolean isEntryPresent(ReadableArchive location, String entry) { boolean entryPresent = false; try { entryPresent = location.exists(entry); } catch (IOException e) { // ignore } return entryPresent; }
@Override public URI getURI() { /* * This is not arbitrary. By convention, the facade ReadableArchive * will be listed first when the MultiReadableArchive is created. * The URI returned from this method is, for example, added to a * class path. The facade JAR points to the client JAR so adding * the facade URI to a class path essentially adds both. */ return archives[0].getURI(); }
public ReadableArchive getSubArchive(String name) throws IOException { if (filter.accept(delegate, name)) { return delegate.getSubArchive(name); } return null; }
public long getEntrySize(String name) { if (filter.accept(delegate, name)) { return delegate.getEntrySize(name); } return 0; }
/** * Returns the manifest file for this archive, this file is usually located at * the META-INF/MANIFEST location, however, certain archive type can change this * default location or use another mean of expressing manifest information. * * @param archive file * @return manifest instance or null if this archive has no manifest */ public Manifest getManifest(ReadableArchive archive) throws IOException { return archive.getManifest(); }
@Override public long getEntrySize(String name) { for (ReadableArchive ra : archives) { final long size = ra.getEntrySize(name); if (size != 0) { return size; } } return 0; }
@Override public boolean handles(ReadableArchive archive) throws IOException { return detector.handles(archive); }
@Override public boolean exists(String name) throws IOException { for (ReadableArchive ra : archives) { if (ra.exists(name)) { return true; } } return false; }
public ReadableArchiveScannerAdapter(Parser parser, ReadableArchive archive) { this.archive = archive; this.parser = parser; this.uri = archive.getURI(); this.parent = null; }
@Override public boolean exists() { boolean result = true; for (ReadableArchive ra : archives) { result &= ra.exists(); } return result; }
private ReadableArchiveScannerAdapter(ReadableArchiveScannerAdapter parent, ReadableArchive archive, URI uri) { this.parent = parent; this.archive = archive; this.parser = parent.parser; this.uri = uri==null?archive.getURI():uri; }
private boolean isJar(ReadableArchive location) { // check for ejb-jar.xml boolean result = false; try { result = location.exists("META-INF/ejb-jar.xml"); } catch (IOException ioEx) { //TODO } return result; }
private boolean isJar(ReadableArchive location) { // check for ejb-jar.xml boolean result = false; try { result = location.exists("META-INF/ejb-jar.xml"); } catch (IOException ioEx) { //TODO } return result; }