addConfiguredIndexJars
public void addConfiguredIndexJars(Path p)
addConfiguredManifest
public void addConfiguredManifest(Manifest newManifest)
throws ManifestException
Allows the manifest for the archive file to be provided inline
in the build file rather than in an external file.
addMetainf
public void addMetainf(ZipFileSet fs)
Adds a zipfileset to include in the META-INF directory.
cleanUp
protected void cleanUp()
Make sure we don't think we already have a MANIFEST next time this task
gets executed.
- cleanUp in interface Zip
createEmptyZip
protected boolean createEmptyZip(File zipFile)
throws BuildException
Create an empty zip file
- createEmptyZip in interface Zip
- true for historic reasons
findJarName
protected static final String findJarName(String fileName,
String[] classpath)
try to guess the name of the given file.
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.
getResourcesToAdd
protected Zip.ArchiveState getResourcesToAdd(FileSet[] filesets,
File zipFile,
boolean needsUpdate)
throws BuildException
Collect the resources that are newer than the corresponding
entries (or missing) in the original archive.
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.
- getResourcesToAdd in interface Zip
filesets
- The filesets to grab resources fromzipFile
- 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.
- an array of resources to add for each fileset passed in as well
as a flag that indicates whether the archive is uptodate.
grabFilesAndDirs
protected static final void grabFilesAndDirs(String file,
List dirs,
List files)
throws IOException
Grab lists of all root-level files and all directories
contained in the given archive.
reset
public void reset()
reset to default values.
- reset in interface Zip
setFilesetmanifest
public void setFilesetmanifest(Jar.FilesetManifestConfig config)
Behavior when a Manifest is found in a zipfileset or zipgroupfileset file.
Valid values are "skip", "merge", and "mergewithoutmain".
"merge" will merge all of manifests together, and merge this into any
other specified manifests.
"mergewithoutmain" merges everything but the Main section of the manifests.
Default value is "skip".
Note: if this attribute's value is not "skip", the created jar will not
be readable by using java.util.jar.JarInputStream
config
- setting for found manifest behavior.
setIndex
public void setIndex(boolean flag)
Set whether or not to create an index list for classes.
This may speed up classloading in some cases.
setJarfile
public void setJarfile(File jarFile)
Use setDestFile(File) instead
setManifest
public void setManifest(File manifestFile)
The manifest file to use. This can be either the location of a manifest,
or the name of a jar added through a fileset. If its the name of an added
jar, the task expects the manifest to be in the jar at META-INF/MANIFEST.MF.
manifestFile
- the manifest file to use.
setManifestEncoding
public void setManifestEncoding(String manifestEncoding)
Set whether or not to create an index list for classes.
This may speed up classloading in some cases.
writeIndexLikeList
protected final void writeIndexLikeList(List dirs,
List files,
PrintWriter writer)
throws IOException
Writes the directory entries from the first and the filenames
from the second list to the given writer, one entry per line.
zipFile
protected void zipFile(InputStream is,
ZipOutputStream zOut,
String vPath,
long lastModified,
File fromArchive,
int mode)
throws IOException
Overridden from Zip class to deal with manifests and index lists.
- zipFile in interface Zip