| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectpublic class Warextends JarWEB-INF/lib, WEB-INF/classes or
WEB-INF directories of the Web Application Archive.
(The War task is a shortcut for specifying the particular layout of a WAR file.
The same thing can be accomplished by using the prefix and fullpath
attributes of zipfilesets in a Zip or Jar task.)
The extended zipfileset element from the zip task
(with attributes prefix, fullpath, and src)
is available in the War task.
JarNested Class Summary |
Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Jar | |
Jar.FilesetManifestConfig | |
Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Zip | |
Zip.ArchiveState, Zip.Duplicate, Zip.WhenEmpty | |
Field Summary |
Fields inherited from class org.apache.tools.ant.taskdefs.Jar | |
emptyBehavior | |
Fields inherited from class org.apache.tools.ant.taskdefs.Zip | |
addedDirs, archiveType, doubleFilePass, duplicate, emptyBehavior, entries, skipWriting, zipFile | |
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask | |
fileset | |
Fields inherited from class org.apache.tools.ant.ProjectComponent | |
description, location, project | |
Constructor Summary | |
| |
Method Summary | |
void |
|
void |
|
void |
|
protected void |
|
protected void |
|
void |
|
void |
|
void |
|
protected void |
|
Methods inherited from class org.apache.tools.ant.taskdefs.Jar | |
addConfiguredIndexJars, addConfiguredManifest, addConfiguredService, addMetainf, cleanUp, createEmptyZip, finalizeZipOutputStream, findJarName, getResourcesToAdd, grabFilesAndDirs, initZipOutputStream, reset, setFilesetmanifest, setIndex, setJarfile, setManifest, setManifestEncoding, setWhenempty, setWhenmanifestonly, writeIndexLikeList, zipFile | |
Methods inherited from class org.apache.tools.ant.taskdefs.Zip | |
add, addFileset, addParentDirs, addResources, addResources, addZipGroupFileset, addZipfileset, cleanUp, createEmptyZip, execute, executeMain, finalizeZipOutputStream, getComment, getDestFile, getEncoding, getLevel, getNonFileSetResourcesToAdd, getResourcesToAdd, getResourcesToAdd, grabNonFileSetResources, grabResources, initZipOutputStream, isAddingNewFiles, isCompress, isEmpty, isInUpdateMode, reset, selectFileResources, setBasedir, setComment, setCompress, setDestFile, setDuplicate, setEncoding, setFile, setFilesonly, setKeepCompression, setLevel, setRoundUp, setUpdate, setWhenempty, setZipfile, zipDir, zipDir, zipFile, zipFile | |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask | |
XsetIgnore, XsetItems, add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject | |
Methods inherited from class org.apache.tools.ant.Task | |
bindToOwner, execute, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType | |
Methods inherited from class org.apache.tools.ant.ProjectComponent | |
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject | |
public void addClasses(ZipFileSet fs)
add files under WEB-INF/classes
- Parameters:
fs- the zip file set to add
public void addLib(ZipFileSet fs)
add files under WEB-INF/lib/
- Parameters:
fs- the zip file set to add
public void addWebinf(ZipFileSet fs)
files to add under WEB-INF;
- Parameters:
fs- the zip file set to add
protected void cleanUp()
Make sure we don't think we already have a web.xml next time this task gets executed.
protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException
override of parent; validates configuration before initializing the output stream.
- Overrides:
- initZipOutputStream in interface Jar
- Parameters:
zOut- the zip output stream
- Throws:
BuildException- if invalid configuration
public void setNeedxmlfile(boolean needxmlfile)
Set the policy on the web.xml file, that is, whether or not it is needed
- Parameters:
needxmlfile- whether a web.xml file is needed. Default: true
public void setWarfile(File warFile)
Deprecated. since 1.5.x. Use setDestFile(File) instead
Deprecated name of the file to create -use destfile instead.
- Parameters:
warFile- the destination file
public void setWebxml(File descr)
set the deployment descriptor to use (WEB-INF/web.xml); required unless update=true
- Parameters:
descr- the deployment descriptor file
protected void zipFile(File file,
ZipOutputStream zOut,
String vPath,
int mode)
throws IOExceptionOverridden from Zip class to deal with web.xml Here are cases that can arise -not a web.xml file : add -first web.xml : add, remember we added it -same web.xml again: skip -alternate web.xml : warn and skip
- Parameters:
file- the file to add to the archivezOut- the stream to write tovPath- the name this entry shall have in the archivemode- the Unix permissions to set.