org.apache.tools.ant.taskdefs
Class Jar

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
Direct Known Subclasses:
Ear, War

public class Jar
extends Zip

Creates a JAR archive.

Author:
James Davidson duncan@x180.com

Inner classes inherited from class org.apache.tools.ant.taskdefs.Zip
Zip.WhenEmpty
 
Fields inherited from class org.apache.tools.ant.taskdefs.Zip
archiveType, emptyBehavior
 
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()
           
 
Method Summary
 void addConfiguredManifest(Manifest newManifest)
           
 void addMetainf(ZipFileSet fs)
           
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 initZipOutputStream(ZipOutputStream zOut)
           
protected  boolean isUpToDate(FileScanner[] scanners, java.io.File zipFile)
          Check whether the archive is up-to-date;
 void setJarfile(java.io.File jarFile)
           
 void setManifest(java.io.File manifestFile)
           
protected  void zipFile(java.io.File file, ZipOutputStream zOut, java.lang.String vPath)
           
protected  void zipFile(java.io.InputStream is, ZipOutputStream zOut, java.lang.String vPath, long lastModified)
           
 
Methods inherited from class org.apache.tools.ant.taskdefs.Zip
addFiles, addFiles, addFileset, addParentDirs, addZipEntries, addZipfileset, execute, finalizeZipOutputStream, grabFileNames, grabFiles, grabFiles, isAddingNewFiles, setBasedir, setCompress, setEncoding, setFilesonly, setUpdate, setWhenempty, setZipfile, zipDir
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, setDefaultexcludes, setExcludes, setExcludesfile, setIncludes, setIncludesfile, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Jar

public Jar()
Method Detail

setJarfile

public void setJarfile(java.io.File jarFile)

addConfiguredManifest

public void addConfiguredManifest(Manifest newManifest)
                           throws ManifestException

setManifest

public void setManifest(java.io.File manifestFile)

addMetainf

public void addMetainf(ZipFileSet fs)

initZipOutputStream

protected void initZipOutputStream(ZipOutputStream zOut)
                            throws java.io.IOException,
                                   BuildException
Overrides:
initZipOutputStream in class Zip

zipFile

protected void zipFile(java.io.File file,
                       ZipOutputStream zOut,
                       java.lang.String vPath)
                throws java.io.IOException
Overrides:
zipFile in class Zip

zipFile

protected void zipFile(java.io.InputStream is,
                       ZipOutputStream zOut,
                       java.lang.String vPath,
                       long lastModified)
                throws java.io.IOException
Overrides:
zipFile in class Zip

isUpToDate

protected boolean isUpToDate(FileScanner[] scanners,
                             java.io.File zipFile)
                      throws BuildException
Check whether the archive is up-to-date;
Overrides:
isUpToDate in class Zip
Parameters:
scanners - list of prepared scanners containing files to archive
zipFile - intended archive file (may or may not exist)
Returns:
true if nothing need be done (may have done something already); false if archive creation should proceed
Throws:
BuildException - if it likes

createEmptyZip

protected boolean createEmptyZip(java.io.File zipFile)
Description copied from class: Zip
Create an empty zip file
Overrides:
createEmptyZip in class Zip
Following copied from class: org.apache.tools.ant.taskdefs.Zip
Returns:
true if the file is then considered up to date.

cleanUp

protected void cleanUp()
Make sure we don't think we already have a MANIFEST next time this task gets executed.
Overrides:
cleanUp in class Zip


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.