org.apache.tools.ant.taskdefs
public class Jar extends Zip
Since: Ant 1.1
UNKNOWN: category="packaging"
Nested Class Summary | |
---|---|
static class | Jar.FilesetManifestConfig |
Constructor Summary | |
---|---|
Jar() constructor |
Method Summary | |
---|---|
void | addConfiguredIndexJars(Path p) |
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.
|
void | addMetainf(ZipFileSet fs)
Adds a zipfileset to include in the META-INF directory.
|
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 ArchiveState | getResourcesToAdd(FileSet[] filesets, File zipFile, boolean needsUpdate)
Collect the resources that are newer than the corresponding
entries (or missing) in the original archive.
|
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 void | initZipOutputStream(ZipOutputStream zOut) |
void | reset()
reset to default values.
|
void | setFilesetmanifest(Jar.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 | setJarfile(File jarFile) |
void | setManifest(File manifestFile)
The manifest file to use. |
void | setManifestEncoding(String manifestEncoding)
Set whether or not to create an index list for classes.
|
void | setWhenempty(WhenEmpty we) |
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. |
Since: Ant 1.6.2
Parameters: newManifest
Throws: ManifestException
Parameters: fs zipfileset to add
See Also: Zip
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.
Since: Ant 1.7
If we are going to recreate the archive instead of updating
it, all resources should be considered as new, if a single one
is. Because of this, subclasses overriding this method must
call super.getResourcesToAdd
and indicate with the
third arg if they already know that the archive is
out-of-date.
Parameters: filesets The filesets to grab resources from zipFile intended archive file (may or may not exist) needsUpdate whether we already know that the archive is out-of-date. Subclasses overriding this method are supposed to set this value correctly in their call to super.getResourcesToAdd.
Returns: an array of resources to add for each fileset passed in as well as a flag that indicates whether the archive is uptodate.
Throws: BuildException if it likes
Since: Ant 1.7
Since: 1.44, Ant 1.5
See Also: Zip
Parameters: config setting for found manifest behavior.
Deprecated: Use setDestFile(File) instead
Parameters: manifestFile the manifest file to use.
UNKNOWN: ignore="true"
Since: Ant 1.6.2