Method from org.apache.geronimo.deployment.util.UnpackedJarFile Detail: |
public void close() throws IOException {
try {
super.close();
} catch(IOException ignored) {
}
}
|
public Enumeration entries() {
Collection files = DeploymentUtil.listRecursiveFiles(baseDir);
Manifest manifest = getManifestSafe();
LinkedList entries = new LinkedList();
URI baseURI = baseDir.getAbsoluteFile().toURI();
for (Iterator iterator = files.iterator(); iterator.hasNext();) {
File entryFile = ((File) iterator.next()).getAbsoluteFile();
URI entryURI = entryFile.toURI();
URI relativeURI = baseURI.relativize(entryURI);
entries.add(new UnpackedJarEntry(relativeURI.getPath(), entryFile, manifest));
}
return Collections.enumeration(entries);
}
|
protected void finalize() throws IOException {
}
|
public File getBaseDir() {
return baseDir;
}
|
public ZipEntry getEntry(String name) {
return getUnpackedJarEntry(name);
}
|
public File getFile(String name) {
File file = new File(baseDir, name);
if (!file.exists()) {
return null;
}
return file;
}
|
public InputStream getInputStream(ZipEntry zipEntry) throws IOException {
File file;
if (zipEntry instanceof UnpackedJarEntry) {
file = ((UnpackedJarEntry)zipEntry).getFile();
} else {
file = getFile(zipEntry.getName());
}
if (file == null) {
throw new IOException("Entry not found: name=" + zipEntry.getName());
} else if (file.isDirectory()) {
return new DeploymentUtil.EmptyInputStream();
}
return new FileInputStream(file);
}
|
public JarEntry getJarEntry(String name) {
return getUnpackedJarEntry(name);
}
|
public Manifest getManifest() throws IOException {
if (!manifestLoaded) {
File manifestFile = getFile("META-INF/MANIFEST.MF");
if (manifestFile != null && manifestFile.isFile()) {
FileInputStream in = null;
try {
in = new FileInputStream(manifestFile);
manifest = new Manifest(in);
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
// ignore
}
}
}
}
manifestLoaded = true;
}
return manifest;
}
|
public String getName() {
return baseDir.getAbsolutePath();
}
|
public UnpackedJarEntry getUnpackedJarEntry(String name) {
File file = getFile(name);
if (file == null) {
return null;
}
return new UnpackedJarEntry(name, file, getManifestSafe());
}
|
public int size() {
return -1;
}
|