| org.apache.tools.ant.taskdefs.MatchingTask org.apache.tools.ant.taskdefs.Zip org.apache.tools.ant.taskdefs.Jar org.apache.tools.ant.taskdefs.War
War | public class War extends Jar (Code) | | 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 |
Constructor Summary | |
public | War() Constructor for the War Task. |
War | public War()(Code) | | Constructor for the War Task.
|
addClasses | public void addClasses(ZipFileSet fs)(Code) | | add files under WEB-INF/classes
Parameters: fs - the zip file set to add |
addLib | public void addLib(ZipFileSet fs)(Code) | | add files under WEB-INF/lib/
Parameters: fs - the zip file set to add |
addWebinf | public void addWebinf(ZipFileSet fs)(Code) | | files to add under WEB-INF;
Parameters: fs - the zip file set to add |
cleanUp | protected void cleanUp()(Code) | | Make sure we don't think we already have a web.xml next time this task
gets executed.
|
setNeedxmlfile | public void setNeedxmlfile(boolean needxmlfile)(Code) | | 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 |
setWarfile | public void setWarfile(File warFile)(Code) | | Deprecated name of the file to create
-use destfile instead.
Parameters: warFile - the destination file |
setWebxml | public void setWebxml(File descr)(Code) | | set the deployment descriptor to use (WEB-INF/web.xml);
required unless update=true
Parameters: descr - the deployment descriptor file |
zipFile | protected void zipFile(File file, ZipOutputStream zOut, String vPath, int mode) throws IOException(Code) | | 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
Parameters: file - the file to add to the archive Parameters: zOut - the stream to write to Parameters: vPath - the name this entry shall have in the archive Parameters: mode - the Unix permissions to set. throws: IOException - on output error |
Methods inherited from org.apache.tools.ant.taskdefs.Jar | public void addConfiguredIndexJars(Path p)(Code)(Java Doc) public void addConfiguredManifest(Manifest newManifest) throws ManifestException(Code)(Java Doc) public void addConfiguredService(Service service)(Code)(Java Doc) public void addMetainf(ZipFileSet fs)(Code)(Java Doc) protected void cleanUp()(Code)(Java Doc) protected boolean createEmptyZip(File zipFile) throws BuildException(Code)(Java Doc) protected void finalizeZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException(Code)(Java Doc) final protected static String findJarName(String fileName, String[] classpath)(Code)(Java Doc) protected ArchiveState getResourcesToAdd(ResourceCollection[] rcs, File zipFile, boolean needsUpdate) throws BuildException(Code)(Java Doc) final protected static void grabFilesAndDirs(String file, List dirs, List files) throws IOException(Code)(Java Doc) protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException(Code)(Java Doc) public void reset()(Code)(Java Doc) public void setFilesetmanifest(FilesetManifestConfig config)(Code)(Java Doc) public void setIndex(boolean flag)(Code)(Java Doc) public void setJarfile(File jarFile)(Code)(Java Doc) public void setManifest(File manifestFile)(Code)(Java Doc) public void setManifestEncoding(String manifestEncoding)(Code)(Java Doc) public void setWhenempty(WhenEmpty we)(Code)(Java Doc) public void setWhenmanifestonly(WhenEmpty we)(Code)(Java Doc) final protected void writeIndexLikeList(List dirs, List files, PrintWriter writer) throws IOException(Code)(Java Doc) protected void zipFile(InputStream is, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) throws IOException(Code)(Java Doc)
|
Methods inherited from org.apache.tools.ant.taskdefs.Zip | public void add(ResourceCollection a)(Code)(Java Doc) public void addFileset(FileSet set)(Code)(Java Doc) final protected void addParentDirs(File baseDir, String entry, ZipOutputStream zOut, String prefix, int dirMode) throws IOException(Code)(Java Doc) final protected void addResources(FileSet fileset, Resource[] resources, ZipOutputStream zOut) throws IOException(Code)(Java Doc) final protected void addResources(ResourceCollection rc, Resource[] resources, ZipOutputStream zOut) throws IOException(Code)(Java Doc) public void addZipGroupFileset(FileSet set)(Code)(Java Doc) public void addZipfileset(ZipFileSet set)(Code)(Java Doc) protected void cleanUp()(Code)(Java Doc) protected boolean createEmptyZip(File zipFile) throws BuildException(Code)(Java Doc) public void execute() throws BuildException(Code)(Java Doc) public void executeMain() throws BuildException(Code)(Java Doc) protected void finalizeZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException(Code)(Java Doc) public String getComment()(Code)(Java Doc) public File getDestFile()(Code)(Java Doc) public String getEncoding()(Code)(Java Doc) public int getLevel()(Code)(Java Doc) protected ArchiveState getNonFileSetResourcesToAdd(ResourceCollection[] rcs, File zipFile, boolean needsUpdate) throws BuildException(Code)(Java Doc) protected ArchiveState getResourcesToAdd(ResourceCollection[] rcs, File zipFile, boolean needsUpdate) throws BuildException(Code)(Java Doc) protected ArchiveState getResourcesToAdd(FileSet[] filesets, File zipFile, boolean needsUpdate) throws BuildException(Code)(Java Doc) protected Resource[][] grabNonFileSetResources(ResourceCollection[] rcs)(Code)(Java Doc) protected Resource[][] grabResources(FileSet[] filesets)(Code)(Java Doc) protected void initZipOutputStream(ZipOutputStream zOut) throws IOException, BuildException(Code)(Java Doc) final protected boolean isAddingNewFiles()(Code)(Java Doc) public boolean isCompress()(Code)(Java Doc) final protected static boolean isEmpty(Resource[][] r)(Code)(Java Doc) public boolean isInUpdateMode()(Code)(Java Doc) public void reset()(Code)(Java Doc) protected Resource[] selectFileResources(Resource[] orig)(Code)(Java Doc) public void setBasedir(File baseDir)(Code)(Java Doc) public void setComment(String comment)(Code)(Java Doc) public void setCompress(boolean c)(Code)(Java Doc) public void setDestFile(File destFile)(Code)(Java Doc) public void setDuplicate(Duplicate df)(Code)(Java Doc) public void setEncoding(String encoding)(Code)(Java Doc) public void setFile(File file)(Code)(Java Doc) public void setFilesonly(boolean f)(Code)(Java Doc) public void setKeepCompression(boolean keep)(Code)(Java Doc) public void setLevel(int level)(Code)(Java Doc) public void setRoundUp(boolean r)(Code)(Java Doc) public void setUpdate(boolean c)(Code)(Java Doc) public void setWhenempty(WhenEmpty we)(Code)(Java Doc) public void setZipfile(File zipFile)(Code)(Java Doc) protected void zipDir(File dir, ZipOutputStream zOut, String vPath, int mode) throws IOException(Code)(Java Doc) protected void zipDir(File dir, ZipOutputStream zOut, String vPath, int mode, ZipExtraField[] extra) throws IOException(Code)(Java Doc) protected void zipFile(InputStream in, ZipOutputStream zOut, String vPath, long lastModified, File fromArchive, int mode) throws IOException(Code)(Java Doc) protected void zipFile(File file, ZipOutputStream zOut, String vPath, int mode) throws IOException(Code)(Java Doc)
|
|
|