|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.core.util.jar.EnhancedJarFile
This class enhances functionality of java.util.jar.JarFile. Additional functionality includes jar entry removal, the ability to list the entries within a directory within the jar, and the ability to get an output stream for modifying extisting entries.
Copyright 2002 Sapient
Field Summary | |
private JarFile |
jar
|
static String |
JAR_DELIMETER
|
private org.apache.commons.logging.Log |
log
Provides a handle to Apache-commons logger |
Constructor Summary | |
EnhancedJarFile(File file)
|
|
EnhancedJarFile(File file,
boolean verify)
|
|
EnhancedJarFile(File file,
boolean verify,
int mode)
|
|
EnhancedJarFile(String name)
|
|
EnhancedJarFile(String name,
boolean verify)
|
Method Summary | |
void |
close()
|
Enumeration |
entries()
|
ZipEntry |
getEntry(String arg0)
|
JarEntryOutputStream |
getEntryOutputStream(String entryName)
Creates a new output entry stream within the jar. |
InputStream |
getInputStream(ZipEntry arg0)
|
JarEntry |
getJarEntry(String arg0)
|
Manifest |
getManifest()
|
String |
getName()
|
List |
listSubEntries(String entryName)
Returns a list of entries that are immediately below the entry named by entryName in the jar's directory structure. |
void |
removeEntry(JarEntry entry)
Removes the given entry from the jar. |
int |
size()
|
(package private) void |
swapJars(File newJarFile)
Utility method used to swap the underlying jar file out for the new one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String JAR_DELIMETER
private org.apache.commons.logging.Log log
private JarFile jar
Constructor Detail |
public EnhancedJarFile(String name) throws IOException
JarFile.JarFile(java.lang.String)
public EnhancedJarFile(String name, boolean verify) throws IOException
JarFile.JarFile(java.lang.String, boolean)
public EnhancedJarFile(File file) throws IOException
JarFile.JarFile(java.io.File)
public EnhancedJarFile(File file, boolean verify) throws IOException
JarFile.JarFile(java.io.File, boolean)
public EnhancedJarFile(File file, boolean verify, int mode) throws IOException
JarFile.JarFile(java.io.File, boolean, int)
Method Detail |
public List listSubEntries(String entryName)
entryName
- the name of the directory entry name
public JarEntryOutputStream getEntryOutputStream(String entryName)
entryName
- name of the entry for which to create an output
stream.
public void removeEntry(JarEntry entry) throws IOException
entry
- entry to be removed
IOException
- if there is a problem writing the changes
to the jarpublic Enumeration entries()
JarFile.entries()
public ZipEntry getEntry(String arg0)
JarFile.getEntry(java.lang.String)
public InputStream getInputStream(ZipEntry arg0) throws IOException
IOException
JarFile.getInputStream(java.util.zip.ZipEntry)
public JarEntry getJarEntry(String arg0)
JarFile.getJarEntry(java.lang.String)
public Manifest getManifest() throws IOException
IOException
JarFile.getManifest()
public void close() throws IOException
IOException
ZipFile.close()
public String getName()
ZipFile.getName()
public int size()
ZipFile.size()
void swapJars(File newJarFile) throws IOException
This is used when modifying the jar (removal, addition, or changes of entries)
newJarFile
- the file object pointing to the new jar file
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |