|
Jar (Apache Ant API)
org.apache.tools.ant.taskdefs
|
Nested Class Summary | |
static class |
Jar.FilesetManifestConfig
|
Nested classes inherited from class org.apache.tools.ant.taskdefs.Zip |
Zip.Duplicate, Zip.WhenEmpty |
Field Summary |
Fields inherited from class org.apache.tools.ant.taskdefs.Zip |
addedDirs, archiveType, duplicate, emptyBehavior, entries, zipFile |
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
fileset, useDefaultExcludes |
Fields inherited from class org.apache.tools.ant.Task |
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
project |
Constructor Summary | |
Jar()
constructor |
Method Summary | |
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(java.io.File zipFile)
Create an empty zip file |
protected void |
finalizeZipOutputStream(ZipOutputStream zOut)
method for subclasses to override |
protected void |
initZipOutputStream(ZipOutputStream zOut)
method for subclasses to override |
protected boolean |
isUpToDate(FileScanner[] scanners,
java.io.File zipFile)
Check whether the archive is up-to-date; |
void |
reset()
reset to default values. |
void |
setIndex(boolean flag)
Set whether or not to create an index list for classes. |
void |
setJarfile(java.io.File jarFile)
Deprecated. Use setDestFile(File) instead |
void |
setManifest(java.io.File manifestFile)
The manifest file to use. |
void |
setWhenempty(Zip.WhenEmpty we)
Sets behavior of the task when no files match. |
protected void |
zipFile(java.io.File file,
ZipOutputStream zOut,
java.lang.String vPath)
Overriden from Zip class to deal with manifests |
protected void |
zipFile(java.io.InputStream is,
ZipOutputStream zOut,
java.lang.String vPath,
long lastModified,
java.io.File file)
Overriden from Zip class to deal with manifests |
Methods inherited from class org.apache.tools.ant.taskdefs.Zip |
addFiles, addFiles, addFileset, addParentDirs, addZipEntries, addZipfileset, addZipGroupFileset, execute, grabFileNames, grabFiles, grabFiles, isAddingNewFiles, isInUpdateMode, setBasedir, setCompress, setDestFile, setDuplicate, setEncoding, setFile, setFilesonly, setUpdate, setZipfile, zipDir |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
addAnd, addContains, addCustom, addDate, addDepend, addDepth, addFilename, addMajority, addNone, addNot, addOr, addPresent, addSelector, addSize, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems |
Methods inherited from class org.apache.tools.ant.Task |
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
getProject |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Jar()
Method Detail |
public void setWhenempty(Zip.WhenEmpty we)
Zip
fail
(throw an exception
and halt the build); skip
(do not create
any archive, but issue a warning); create
(make an archive with no entries).
Default for zip tasks is skip
;
for jar tasks, create
.
setWhenempty
in class Zip
public void setJarfile(java.io.File jarFile)
public void setIndex(boolean flag)
public void addConfiguredManifest(Manifest newManifest) throws ManifestException
newManifest
-
ManifestException
public void setManifest(java.io.File manifestFile)
manifestFile
- public void addMetainf(ZipFileSet fs)
fs
- zipfileset to addprotected void initZipOutputStream(ZipOutputStream zOut) throws java.io.IOException, BuildException
Zip
initZipOutputStream
in class Zip
java.io.IOException
BuildException
protected void finalizeZipOutputStream(ZipOutputStream zOut) throws java.io.IOException, BuildException
Zip
finalizeZipOutputStream
in class Zip
java.io.IOException
BuildException
protected void zipFile(java.io.File file, ZipOutputStream zOut, java.lang.String vPath) throws java.io.IOException
protected void zipFile(java.io.InputStream is, ZipOutputStream zOut, java.lang.String vPath, long lastModified, java.io.File file) throws java.io.IOException
protected boolean isUpToDate(FileScanner[] scanners, java.io.File zipFile) throws BuildException
isUpToDate
in class Zip
scanners
- list of prepared scanners containing files to archivezipFile
- intended archive file (may or may not exist)
BuildException
- if it likesprotected boolean createEmptyZip(java.io.File zipFile)
Zip
createEmptyZip
in class Zip
protected void cleanUp()
Zip.cleanUp()
public void reset()
Zip.reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |