FileDocCategorySizeDatePackage
DefaultExcludes.javaAPI DocApache Ant 1.703637Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs

DefaultExcludes

public class DefaultExcludes extends org.apache.tools.ant.Task
Alters the default excludes for the entire build..
since
Ant 1.6
ant.task
category="utility"

Fields Summary
private String
add
private String
remove
private boolean
defaultrequested
private boolean
echo
private int
logLevel
Constructors Summary
Methods Summary
public voidexecute()
Does the work.

exception
BuildException if something goes wrong with the build


                     
         
        if (!defaultrequested && add.equals("") && remove.equals("") && !echo) {
            throw new BuildException("<defaultexcludes> task must set "
                + "at least one attribute (echo=\"false\""
                + " doesn't count since that is the default");
        }
        if (defaultrequested) {
            DirectoryScanner.resetDefaultExcludes();
        }
        if (!add.equals("")) {
            DirectoryScanner.addDefaultExclude(add);
        }
        if (!remove.equals("")) {
            DirectoryScanner.removeDefaultExclude(remove);
        }
        if (echo) {
            StringBuffer message
                = new StringBuffer("Current Default Excludes:");
            message.append(StringUtils.LINE_SEP);
            String[] excludes = DirectoryScanner.getDefaultExcludes();
            for (int i = 0; i < excludes.length; i++) {
                message.append("  ");
                message.append(excludes[i]);
                message.append(StringUtils.LINE_SEP);
            }
            log(message.toString(), logLevel);
        }
    
public voidsetAdd(java.lang.String add)
Pattern to add to the default excludes

param
add Sets the value for the pattern to exclude.

        this.add = add;
    
public voidsetDefault(boolean def)
go back to standard default patterns

param
def if true go back to default patterns

        defaultrequested = def;
    
public voidsetEcho(boolean echo)
If true, echo the default excludes.

param
echo whether or not to echo the contents of the default excludes.

        this.echo = echo;
    
public voidsetRemove(java.lang.String remove)
Pattern to remove from the default excludes.

param
remove Sets the value for the pattern that should no longer be excluded.

        this.remove = remove;