War (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs, class: War

# Class War

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.tools.ant.taskdefs.Zip
org.apache.tools.ant.taskdefs.Jar
org.apache.tools.ant.taskdefs.War

All Implemented Interfaces:
  `Cloneable, SelectorContainer`

public class War extends Jar

An extension of <jar> to create a WAR archive. Contains special treatment for files that should end up in the `WEB-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.

Since:
  Ant 1.2
See Also:
  - `Jar`

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Jar

  `Jar.FilesetManifestConfig, Jar.StrictMode`
  Modifier and Type
  Class
  Description
  `static class`
  `Jar.FilesetManifestConfig`
  The manifest config enumerated type.
  `static class`
  `Jar.StrictMode`
  The strict enumerated type.

  ### Nested classes/interfaces inherited from class Zip

  `Zip.ArchiveState, Zip.Duplicate, Zip.UnicodeExtraField, Zip.WhenEmpty, Zip.Zip64ModeAttribute`
  Modifier and Type
  Class
  Description
  `static class`
  `Zip.ArchiveState`
  Holds the up-to-date status and the out-of-date resources of the original archive.
  `static class`
  `Zip.Duplicate`
  Possible behaviors when a duplicate file is added: "add", "preserve" or "fail"
  `static final class`
  `Zip.UnicodeExtraField`
  Policy for creation of Unicode extra fields: never, always or not-encodeable.
  `static class`
  `Zip.WhenEmpty`
  Possible behaviors when there are no matching files for the task: "fail", "skip", or "create".
  `static final class`
  `Zip.Zip64ModeAttribute`
  The choices for Zip64 extensions.

- ## Field Summary

  ### Fields inherited from class Zip

  `addedDirs, archiveType, doubleFilePass, duplicate, emptyBehavior, entries, skipWriting, zipFile`
  Modifier and Type
  Field
  Description
  `protected Hashtable<String,String>`
  `addedDirs`
  `protected String`
  `archiveType`
  `protected boolean`
  `doubleFilePass`
  If this flag is true, execute() will run most operations twice, the first time with `skipWriting` set to true and the second time with setting it to false.
  `protected String`
  `duplicate`
  `protected String`
  `emptyBehavior`
  `protected Hashtable<String,String>`
  `entries`
  `protected boolean`
  `skipWriting`
  whether the methods should just perform some sort of dry-run.
  `protected File`
  `zipFile`

  ### Fields inherited from class MatchingTask

  `fileset`
  Modifier and Type
  Field
  Description
  `protected FileSet`
  `fileset`

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `War()`
  Constructor for the War Task.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addClasses(ZipFileSet fs)`
  add files under WEB-INF/classes
  `void`
  `addLib(ZipFileSet fs)`
  add files under WEB-INF/lib/
  `void`
  `addWebinf(ZipFileSet fs)`
  files to add under WEB-INF;
  `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)`
  override of parent; validates configuration before initializing the output stream.
  `void`
  `setNeedxmlfile(boolean needxmlfile)`
  Set the policy on the web.xml file, that is, whether or not it is needed
  `void`
  `setWarfile(File warFile)`
  Deprecated.
  since 1.5.x.
  `void`
  `setWebxml(File descr)`
  set the deployment descriptor to use (WEB-INF/web.xml); required unless `update=true`
  `protected void`
  `zipFile(File file, ZipOutputStream zOut, String vPath, int mode)`
  Overridden 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

  ### Methods inherited from class Jar

  `addConfiguredIndexJars, addConfiguredIndexJarsMapper, addConfiguredManifest, addConfiguredService, addMetainf, createEmptyZip, finalizeZipOutputStream, findJarName, getIndexJarsMapper, getResourcesToAdd, grabFilesAndDirs, reset, setFilesetmanifest, setFlattenAttributes, setIndex, setIndexMetaInf, setJarfile, setManifest, setManifestEncoding, setMergeClassPathAttributes, setStrict, setWhenempty, setWhenmanifestonly, writeIndexLikeList, zipFile`
  Modifier and Type
  Method
  Description
  `void`
  `addConfiguredIndexJars(Path p)`
  Add a path to index jars.
  `void`
  `addConfiguredIndexJarsMapper(Mapper mapper)`
  Add a mapper used to convert the jars to entries in the index.
  `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`
  `addConfiguredService(Service service)`
  A nested SPI service element.
  `void`
  `addMetainf(ZipFileSet fs)`
  Adds a zipfileset to include in the META-INF directory.
  `protected boolean`
  `createEmptyZip(File zipFile)`
  Create an empty jar file.
  `protected void`
  `finalizeZipOutputStream(ZipOutputStream zOut)`
  Finalize the zip output stream.
  `protected static String`
  `findJarName(String fileName, String[] classpath)`
  try to guess the name of the given file.
  `FileNameMapper`
  `getIndexJarsMapper()`
  Returns the mapper used to convert the jars to entries in the index.
  `protected Zip.ArchiveState`
  `getResourcesToAdd(ResourceCollection[] rcs, 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<String> dirs, List<String> files)`
  Grab lists of all root-level files and all directories contained in the given archive.
  `void`
  `reset()`
  reset to default values.
  `void`
  `setFilesetmanifest(Jar.FilesetManifestConfig config)`
  Behavior when a Manifest is found in a zipfileset or zipgroupfileset file.
  `void`
  `setFlattenAttributes(boolean b)`
  Whether to flatten multi-valued attributes (i.e.
  `void`
  `setIndex(boolean flag)`
  Set whether or not to create an index list for classes.
  `void`
  `setIndexMetaInf(boolean flag)`
  Set whether or not to add META-INF and its children to the index.
  `void`
  `setJarfile(File jarFile)`
  Deprecated.
  since 1.5.x.
  `void`
  `setManifest(File manifestFile)`
  The manifest file to use.
  `void`
  `setManifestEncoding(String manifestEncoding)`
  The character encoding to use in the manifest file.
  `void`
  `setMergeClassPathAttributes(boolean b)`
  Whether to merge Class-Path attributes.
  `void`
  `setStrict(Jar.StrictMode strict)`
  Activate the strict mode.
  `void`
  `setWhenempty(Zip.WhenEmpty we)`
  Not used for jar files.
  `void`
  `setWhenmanifestonly(Zip.WhenEmpty we)`
  Indicates if a jar file should be created when it would only contain a manifest file.
  `protected final void`
  `writeIndexLikeList(List<String> dirs, List<String> 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.

  ### Methods inherited from class Zip

  `add, addFileset, addParentDirs, addResources, addResources, addZipfileset, addZipGroupFileset, execute, executeMain, getComment, getCreateUnicodeExtraFields, getCurrentExtraFields, getDestFile, getEncoding, getFallBackToUTF8, getLevel, getModificationtime, getNonFileSetResourcesToAdd, getPreserve0Permissions, getResourcesToAdd, getUseLanguageEnodingFlag, getZip64Mode, grabNonFileSetResources, grabResources, hasUpdatedFile, isAddingNewFiles, isCompress, isEmpty, isFirstPass, isInUpdateMode, logWhenWriting, selectDirectoryResources, selectFileResources, selectResources, setBasedir, setComment, setCompress, setCreateUnicodeExtraFields, setCurrentExtraFields, setDestFile, setDuplicate, setEncoding, setFallBackToUTF8, setFile, setFilesonly, setKeepCompression, setLevel, setModificationtime, setPreserve0Permissions, setRoundUp, setUpdate, setUseLanguageEncodingFlag, setZip64Mode, setZipfile, zipDir, zipDir, zipDir, zipFile`
  Modifier and Type
  Method
  Description
  `void`
  `add(ResourceCollection a)`
  Add a collection of resources to be archived.
  `void`
  `addFileset(FileSet set)`
  Adds a set of files.
  `protected final void`
  `addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix, int dirMode)`
  Ensure all parent dirs of a given entry have been added.
  `protected final void`
  `addResources(FileSet fileset, Resource[] resources, ZipOutputStream zOut)`
  Add the given resources.
  `protected final void`
  `addResources(ResourceCollection rc, Resource[] resources, ZipOutputStream zOut)`
  Add the given resources.
  `void`
  `addZipfileset(ZipFileSet set)`
  Adds a set of files that can be read from an archive and be given a prefix/fullpath.
  `void`
  `addZipGroupFileset(FileSet set)`
  Adds a group of zip files.
  `void`
  `execute()`
  validate and build
  `void`
  `executeMain()`
  Build the zip file.
  `String`
  `getComment()`
  Comment of the archive
  `Zip.UnicodeExtraField`
  `getCreateUnicodeExtraFields()`
  Whether Unicode extra fields will be created.
  `protected final ZipExtraField[]`
  `getCurrentExtraFields()`
  Provides the extra fields for the zip entry currently being added to the archive - if any.
  `File`
  `getDestFile()`
  The file to create.
  `String`
  `getEncoding()`
  Encoding to use for filenames.
  `boolean`
  `getFallBackToUTF8()`
  Whether to fall back to UTF-8 if a name cannot be encoded using the specified encoding.
  `int`
  `getLevel()`
  Get the compression level.
  `String`
  `getModificationtime()`
  The file modification time previously provided to `Zip.setModificationtime(String)` or `null` if unset.
  `protected Zip.ArchiveState`
  `getNonFileSetResourcesToAdd(ResourceCollection[] rcs, File zipFile, boolean needsUpdate)`
  Collect the resources that are newer than the corresponding entries (or missing) in the original archive.
  `boolean`
  `getPreserve0Permissions()`
  Assume 0 Unix mode is intentional.
  `protected Zip.ArchiveState`
  `getResourcesToAdd(FileSet[] filesets, File zipFile, boolean needsUpdate)`
  Collect the resources that are newer than the corresponding entries (or missing) in the original archive.
  `boolean`
  `getUseLanguageEnodingFlag()`
  Whether the language encoding flag will be used.
  `Zip.Zip64ModeAttribute`
  `getZip64Mode()`
  Whether Zip64 extensions will be used.
  `protected Resource[][]`
  `grabNonFileSetResources(ResourceCollection[] rcs)`
  Fetch all included and not excluded resources from the collections.
  `protected Resource[][]`
  `grabResources(FileSet[] filesets)`
  Fetch all included and not excluded resources from the sets.
  `protected boolean`
  `hasUpdatedFile()`
  Get the value of the updatedFile attribute.
  `protected final boolean`
  `isAddingNewFiles()`
  Indicates if the task is adding new files into the archive as opposed to copying back unchanged files from the backup copy
  `boolean`
  `isCompress()`
  Whether we want to compress the files or only store them;
  `protected static final boolean`
  `isEmpty(Resource[][] r)`
  Check is the resource arrays are empty.
  `protected final boolean`
  `isFirstPass()`
  Whether this is the first time the archive building methods are invoked.
  `boolean`
  `isInUpdateMode()`
  Are we updating an existing archive?
  `protected void`
  `logWhenWriting(String msg, int level)`
  Logs a message at the given output level, but only if this is the pass that will actually create the archive.
  `protected Resource[]`
  `selectDirectoryResources(Resource[] orig)`
  Drops all non-directory resources from the given array.
  `protected Resource[]`
  `selectFileResources(Resource[] orig)`
  Drops all non-file resources from the given array.
  `protected Resource[]`
  `selectResources(Resource[] orig, ResourceSelector selector)`
  Drops all resources from the given array that are not selected
  `void`
  `setBasedir(File baseDir)`
  Directory from which to archive files; optional.
  `void`
  `setComment(String comment)`
  Comment to use for archive.
  `void`
  `setCompress(boolean c)`
  Whether we want to compress the files or only store them; optional, default=true;
  `void`
  `setCreateUnicodeExtraFields(Zip.UnicodeExtraField b)`
  Whether Unicode extra fields will be created.
  `protected final void`
  `setCurrentExtraFields(ZipExtraField[] extra)`
  Sets the extra fields for the zip entry currently being added to the archive - if any.
  `void`
  `setDestFile(File destFile)`
  The file to create; required.
  `void`
  `setDuplicate(Zip.Duplicate df)`
  Sets behavior for when a duplicate file is about to be added - one of `add`, `preserve` or `fail`.
  `void`
  `setEncoding(String encoding)`
  Encoding to use for filenames, defaults to the platform's default encoding.
  `void`
  `setFallBackToUTF8(boolean b)`
  Whether to fall back to UTF-8 if a name cannot be encoded using the specified encoding.
  `void`
  `setFile(File file)`
  Deprecated.
  since 1.5.x.
  `void`
  `setFilesonly(boolean f)`
  If true, emulate Sun's jar utility by not adding parent directories; optional, defaults to false.
  `void`
  `setKeepCompression(boolean keep)`
  Whether the original compression of entries coming from a ZIP archive should be kept (for example when updating an archive).
  `void`
  `setLevel(int level)`
  Set the compression level to use.
  `void`
  `setModificationtime(String time)`
  Set all stored file modification times to `time`.
  `void`
  `setPreserve0Permissions(boolean b)`
  Assume 0 Unix mode is intentional.
  `void`
  `setRoundUp(boolean r)`
  Whether the file modification times will be rounded up to the next even number of seconds.
  `void`
  `setUpdate(boolean c)`
  If true, updates an existing file, otherwise overwrite any existing one; optional defaults to false.
  `void`
  `setUseLanguageEncodingFlag(boolean b)`
  Whether to set the language encoding flag.
  `void`
  `setZip64Mode(Zip.Zip64ModeAttribute b)`
  Whether Zip64 extensions should be used.
  `void`
  `setZipfile(File zipFile)`
  Deprecated.
  since 1.5.x.
  `protected void`
  `zipDir(File dir, ZipOutputStream zOut, String vPath, int mode)`
  Add a directory to the zip stream.
  `protected void`
  `zipDir(File dir, ZipOutputStream zOut, String vPath, int mode, ZipExtraField[] extra)`
  Add a directory to the zip stream.
  `protected void`
  `zipDir(Resource dir, ZipOutputStream zOut, String vPath, int mode, ZipExtraField[] extra)`
  Add a directory to the zip stream.
  `protected final void`
  `zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode, ZipExtraField[] extra)`
  Adds a new entry to the archive, takes care of duplicates as well.

  ### Methods inherited from class MatchingTask

  `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, XsetIgnore, XsetItems`
  Modifier and Type
  Method
  Description
  `void`
  `add(FileSelector selector)`
  add an arbitrary selector
  `void`
  `addAnd(AndSelector selector)`
  add an "And" selector entry on the selector list
  `void`
  `addContains(ContainsSelector selector)`
  add a contains selector entry on the selector list
  `void`
  `addContainsRegexp(ContainsRegexpSelector selector)`
  add a regular expression selector entry on the selector list
  `void`
  `addCustom(ExtendSelector selector)`
  add an extended selector entry on the selector list
  `void`
  `addDate(DateSelector selector)`
  add a selector date entry on the selector list
  `void`
  `addDepend(DependSelector selector)`
  add a depends selector entry on the selector list
  `void`
  `addDepth(DepthSelector selector)`
  add a depth selector entry on the selector list
  `void`
  `addDifferent(DifferentSelector selector)`
  add a type selector entry on the type list
  `void`
  `addFilename(FilenameSelector selector)`
  add a selector filename entry on the selector list
  `void`
  `addMajority(MajoritySelector selector)`
  add a majority selector entry on the selector list
  `void`
  `addModified(ModifiedSelector selector)`
  add the modified selector
  `void`
  `addNone(NoneSelector selector)`
  add a "None" selector entry on the selector list
  `void`
  `addNot(NotSelector selector)`
  add a "Not" selector entry on the selector list
  `void`
  `addOr(OrSelector selector)`
  add an "Or" selector entry on the selector list
  `void`
  `addPresent(PresentSelector selector)`
  add a present selector entry on the selector list
  `void`
  `addSelector(SelectSelector selector)`
  add a "Select" selector entry on the selector list
  `void`
  `addSize(SizeSelector selector)`
  add a selector size entry on the selector list
  `void`
  `addType(TypeSelector selector)`
  add a type selector entry on the type list
  `void`
  `appendSelector(FileSelector selector)`
  Add a new selector into this container.
  `PatternSet.NameEntry`
  `createExclude()`
  add a name entry on the exclude list
  `PatternSet.NameEntry`
  `createExcludesFile()`
  add a name entry on the include files list
  `PatternSet.NameEntry`
  `createInclude()`
  add a name entry on the include list
  `PatternSet.NameEntry`
  `createIncludesFile()`
  add a name entry on the include files list
  `PatternSet`
  `createPatternSet()`
  add a set of patterns
  `protected DirectoryScanner`
  `getDirectoryScanner(File baseDir)`
  Returns the directory scanner needed to access the files to process.
  `protected final FileSet`
  `getImplicitFileSet()`
  Accessor for the implicit fileset.
  `FileSelector[]`
  `getSelectors(Project p)`
  Returns the set of selectors as an array.
  `boolean`
  `hasSelectors()`
  Indicates whether there are any selectors here.
  `int`
  `selectorCount()`
  Gives the count of the number of selectors in this container
  `Enumeration<FileSelector>`
  `selectorElements()`
  Returns an enumerator for accessing the set of selectors.
  `void`
  `setCaseSensitive(boolean isCaseSensitive)`
  Sets case sensitivity of the file system
  `void`
  `setDefaultexcludes(boolean useDefaultExcludes)`
  Sets whether default exclusions should be used or not.
  `void`
  `setExcludes(String excludes)`
  Sets the set of exclude patterns.
  `void`
  `setExcludesfile(File excludesfile)`
  Sets the name of the file containing the includes patterns.
  `void`
  `setFollowSymlinks(boolean followSymlinks)`
  Sets whether or not symbolic links or Windows junctions should be followed.
  `void`
  `setIncludes(String includes)`
  Sets the set of include patterns.
  `void`
  `setIncludesfile(File includesfile)`
  Sets the name of the file containing the includes patterns.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.
  `void`
  `XsetIgnore(String ignoreString)`
  List of filenames and directory names to not include.
  `void`
  `XsetItems(String itemString)`
  Set this to be the items in the base directory that you want to be included.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### War

    public War()
    Constructor for the War Task.

- ## Method Details

  - ### setWarfile

    @Deprecated 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

  - ### setWebxml

    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

  - ### setNeedxmlfile

    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

  - ### addLib

    public void addLib(ZipFileSet fs)
    add files under WEB-INF/lib/
    Parameters:
      `fs` - the zip file set to add

  - ### addClasses

    public void addClasses(ZipFileSet fs)
    add files under WEB-INF/classes
    Parameters:
      `fs` - the zip file set to add

  - ### addWebinf

    public void addWebinf(ZipFileSet fs)
    files to add under WEB-INF;
    Parameters:
      `fs` - the zip file set to add

  - ### initZipOutputStream

    protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException
    override of parent; validates configuration before initializing the output stream.
    Overrides:
      `initZipOutputStream` in class `Jar`
    Parameters:
      `zOut` - the zip output stream
    Throws:
      `IOException` - on output error
      `BuildException` - if invalid configuration

  - ### zipFile

    protected void zipFile(File file, ZipOutputStream zOut, String vPath, int mode) throws IOException
    Overridden 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
    Overrides:
      `zipFile` in class `Zip`
    Parameters:
      `file` - the file to add to the archive
      `zOut` - the stream to write to
      `vPath` - the name this entry shall have in the archive
      `mode` - the Unix permissions to set.
    Throws:
      `IOException` - on output error

  - ### cleanUp

    protected void cleanUp()
    Make sure we don't think we already have a web.xml next time this task gets executed.
    Overrides:
      `cleanUp` in class `Jar`
    See Also:
      - `Zip.cleanUp()`