Search in sources :

Example 6 with Resources

use of org.apache.tools.ant.types.resources.Resources in project ant by apache.

the class Sync method add.

/**
 * Adds a collection of filesystem resources to copy.
 * @param rc a resource collection
 * @since Ant 1.7
 */
public void add(ResourceCollection rc) {
    if (rc instanceof FileSet && rc.isFilesystemOnly()) {
        // receives special treatment in copy that this task relies on
        myCopy.add(rc);
    } else {
        if (resources == null) {
            Restrict r = new Restrict();
            r.add(new Exists());
            resources = new Resources();
            r.add(resources);
            myCopy.add(r);
        }
        resources.add(rc);
    }
}
Also used : AbstractFileSet(org.apache.tools.ant.types.AbstractFileSet) FileSet(org.apache.tools.ant.types.FileSet) Exists(org.apache.tools.ant.types.resources.selectors.Exists) Restrict(org.apache.tools.ant.types.resources.Restrict) Resources(org.apache.tools.ant.types.resources.Resources)

Aggregations

Resources (org.apache.tools.ant.types.resources.Resources)6 BuildException (org.apache.tools.ant.BuildException)2 FileSet (org.apache.tools.ant.types.FileSet)2 Resource (org.apache.tools.ant.types.Resource)2 ResourceCollection (org.apache.tools.ant.types.ResourceCollection)2 Restrict (org.apache.tools.ant.types.resources.Restrict)2 File (java.io.File)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)1 AbstractFileSet (org.apache.tools.ant.types.AbstractFileSet)1 FileProvider (org.apache.tools.ant.types.resources.FileProvider)1 FileResourceIterator (org.apache.tools.ant.types.resources.FileResourceIterator)1 Sort (org.apache.tools.ant.types.resources.Sort)1 Union (org.apache.tools.ant.types.resources.Union)1 Exists (org.apache.tools.ant.types.resources.selectors.Exists)1 FileNameMapper (org.apache.tools.ant.util.FileNameMapper)1 IdentityMapper (org.apache.tools.ant.util.IdentityMapper)1