| java.lang.Object org.sape.carbon.core.util.jar.EnhancedJarFile
EnhancedJarFile | public class EnhancedJarFile (Code) | | 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.
See Also: java.util.jar.JarFile See Also: Copyright 2002 Sapient since: carbon 1.0 author: Doug Voet, April 2002 version: $Revision: 1.11 $ ($Author: dvoet $) |
getEntryOutputStream | public JarEntryOutputStream getEntryOutputStream(String entryName)(Code) | | Creates a new output entry stream within the jar. The entry named
will be created if it does not exist within the jar already.
Parameters: entryName - name of the entry for which to create an outputstream. JarEntryOutputStream |
listSubEntries | public List listSubEntries(String entryName)(Code) | | Returns a list of entries that are
immediately below the entry named by entryName in the jar's directory
structure.
Parameters: entryName - the name of the directory entry name List a list of java.util.jar.JarEntry objects that areimmediately below the entry named by entryName in the jar's directorystructure. |
removeEntry | public void removeEntry(JarEntry entry) throws IOException(Code) | | Removes the given entry from the jar. If the entry does not exist,
the method returns without doing anything.
Parameters: entry - entry to be removed throws: IOException - if there is a problem writing the changesto the jar |
swapJars | void swapJars(File newJarFile) throws IOException(Code) | | Utility method used to swap the underlying jar file out for the new one.
This method closes the old jar file, deletes it, moves the new jar
file to the location where the old one used to be and opens it.
This is used when modifying the jar (removal, addition, or changes
of entries)
Parameters: newJarFile - the file object pointing to the new jar file |
|
|