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.
*/
public void setWhenempty(String we) throws BuildException {
we = we.toLowerCase();
// XXX could instead be using EnumeratedAttribute, but this works
if (!"fail".equals(we) && !"skip".equals(we) && !"create".equals(we))
throw new BuildException("Unrecognized whenempty attribute: " + we);
emptyBehavior = we;
}
public void execute() throws BuildException {
if (baseDir == null && filesets.size() == 0 && "zip".equals(archiveType)) {
throw new BuildException( "basedir attribute must be set, or at least " +
"one fileset or prefixedfileset must be given!" );
}
if (zipFile == null) {
throw new BuildException("You must specify the " + archiveType + " file to create!");
}
// Create the scanners to pass to isUpToDate().
Vector dss = new Vector ();
if (baseDir != null)
dss.addElement(getDirectoryScanner(baseDir));
for (int i=0; iWhen we get here, the Zip file has been closed and all we * need to do is to reset some globals.
*/ protected void cleanUp() {} }