org.codehaus.plexus.archiver.jar
public class JarArchiver extends ZipArchiver
Version: $Revision: 7189 $ $Date: 2008-02-02 03:08:42 +0200 (Sat, 02 Feb 2008) $
Nested Class Summary | |
---|---|
static class | JarArchiver.FilesetManifestConfig |
Constructor Summary | |
---|---|
JarArchiver()
constructor |
Method Summary | |
---|---|
void | addConfiguredIndexJars(File indexJar) |
void | addConfiguredManifest(Manifest newManifest)
Allows the manifest for the archive file to be provided inline
in the build file rather than in an external file.
|
protected void | cleanUp()
Make sure we don't think we already have a MANIFEST next time this task
gets executed.
|
protected boolean | createEmptyZip(File zipFile) |
protected void | finalizeZipOutputStream(ZipOutputStream zOut) |
protected static String | findJarName(String fileName, String[] classpath)
try to guess the name of the given file.
|
protected static void | grabFilesAndDirs(String file, List dirs, List files)
Grab lists of all root-level files and all directories
contained in the given archive. |
protected boolean | hasVirtualFiles() |
protected void | initZipOutputStream(ZipOutputStream zOut) |
void | reset()
reset to default values.
|
void | setFilesetmanifest(JarArchiver.FilesetManifestConfig config)
Behavior when a Manifest is found in a zipfileset or zipgroupfileset file.
|
void | setIndex(boolean flag)
Set whether or not to create an index list for classes.
|
void | setManifest(File manifestFile)
The manifest file to use. |
void | setManifestEncoding(String manifestEncoding)
Set whether or not to create an index list for classes.
|
protected void | writeIndexLikeList(List dirs, List files, PrintWriter writer)
Writes the directory entries from the first and the filenames
from the second list to the given writer, one entry per line. |
protected void | zipFile(InputStream is, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode)
Overridden from Zip class to deal with manifests and index lists. |
Parameters: newManifest
Throws: ManifestException
See Also: ZipArchiver
If this jar has a classpath attribute in its manifest, we can assume that it will only require an index of jars listed there. try to find which classpath entry is most likely the one the given file name points to.
In the absence of a classpath attribute, assume the other files will be placed inside the same directory as this jar and use their basename.
if there is a classpath and the given file doesn't match any of its entries, return null.
See Also: ZipArchiver
Parameters: config setting for found manifest behavior.
Parameters: manifestFile the manifest file to use.