Search in sources :

Example 6 with Restrict

use of org.apache.tools.ant.types.resources.Restrict 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

Restrict (org.apache.tools.ant.types.resources.Restrict)6 Resource (org.apache.tools.ant.types.Resource)5 FileResource (org.apache.tools.ant.types.resources.FileResource)3 StringResource (org.apache.tools.ant.types.resources.StringResource)3 BuildException (org.apache.tools.ant.BuildException)2 FileSet (org.apache.tools.ant.types.FileSet)2 Resources (org.apache.tools.ant.types.resources.Resources)2 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 DirectoryScanner (org.apache.tools.ant.DirectoryScanner)1 AbstractFileSet (org.apache.tools.ant.types.AbstractFileSet)1 ResourceCollection (org.apache.tools.ant.types.ResourceCollection)1 FileProvider (org.apache.tools.ant.types.resources.FileProvider)1 FileResourceIterator (org.apache.tools.ant.types.resources.FileResourceIterator)1 Intersect (org.apache.tools.ant.types.resources.Intersect)1 LogOutputResource (org.apache.tools.ant.types.resources.LogOutputResource)1 Sort (org.apache.tools.ant.types.resources.Sort)1 Union (org.apache.tools.ant.types.resources.Union)1 Date (org.apache.tools.ant.types.resources.selectors.Date)1