Package org.apache.tools.ant.types.resources

Examples of org.apache.tools.ant.types.resources.Resources$MyCollection


     */
    public synchronized void add(ResourceCollection c) {
        if (c == null) {
            return;
        }
        resources = (resources == null) ? new Resources() : resources;
        resources.add(c);
    }
View Full Code Here


     */
    public void add(ResourceCollection rc) {
        if (rc == null) {
            return;
        }
        rcs = (rcs == null) ? new Resources() : rcs;
        rcs.add(rc);
    }
View Full Code Here

            if (verbosity == Project.MSG_VERBOSE) {
                log("Deleting directory " + dir.getAbsolutePath());
            }
            removeDir(dir);
        }
        Resources resourcesToDelete = new Resources();
        resourcesToDelete.setProject(getProject());
        Resources filesetDirs = new Resources();
        filesetDirs.setProject(getProject());
        FileSet implicit = null;
        if (usedMatchingTask && dir != null && dir.isDirectory()) {
            //add the files from the default fileset:
            implicit = getImplicitFileSet();
            implicit.setProject(getProject());
            filesets.add(implicit);
        }

        for (int i = 0, size = filesets.size(); i < size; i++) {
            FileSet fs = (FileSet) filesets.get(i);
            if (fs.getProject() == null) {
                log("Deleting fileset with no project specified;"
                    + " assuming executing project", Project.MSG_VERBOSE);
                fs = (FileSet) fs.clone();
                fs.setProject(getProject());
            }
            File fsDir = fs.getDir();
            if (fsDir == null) {
                throw new BuildException(
                        "File or Resource without directory or file specified");
            } else if (!fsDir.isDirectory()) {
                handle("Directory does not exist:" + fsDir);
            } else {
                resourcesToDelete.add(fs);
                if (includeEmpty) {
                    filesetDirs.add(new ReverseDirs(fsDir, fs
                            .getDirectoryScanner().getIncludedDirectories()));
                }
            }
        }
        resourcesToDelete.add(filesetDirs);
View Full Code Here

        if (rc == null) {
            rc = c;
            return;
        }
        if (!(rc instanceof Resources)) {
            Resources newRc = new Resources();
            newRc.setProject(getProject());
            newRc.add(rc);
            rc = newRc;
        }
        ((Resources) rc).add(c);
    }
View Full Code Here

     * @since Ant 1.7
     */
    public void add(ResourceCollection c) {
        synchronized (this) {
            if (rc == null) {
                rc = new Resources();
                rc.setProject(getProject());
                rc.setCache(true);
            }
        }
        rc.add(c);
View Full Code Here

     */
    public synchronized void add(ResourceCollection c) {
        if (c == null) {
            return;
        }
        resources = (resources == null) ? new Resources() : resources;
        resources.add(c);
    }
View Full Code Here

    public void add(ResourceCollection rc) {
        if (rc == null) {
            return;
        }
        if (rcs == null) {
            rcs = new Resources();
            rcs.setCache(true);
        }
        rcs.add(rc);
    }
View Full Code Here

                    handle("Unable to delete directory "
                           + dir.getAbsolutePath());
                }
            }
        }
        Resources resourcesToDelete = new Resources();
        resourcesToDelete.setProject(getProject());
        resourcesToDelete.setCache(true);
        Resources filesetDirs = new Resources();
        filesetDirs.setProject(getProject());
        filesetDirs.setCache(true);
        FileSet implicit = null;
        if (usedMatchingTask && dir != null && dir.isDirectory()) {
            //add the files from the default fileset:
            implicit = getImplicitFileSet();
            implicit.setProject(getProject());
            filesets.add(implicit);
        }

        final int size = filesets.size();
        for (int i = 0; i < size; i++) {
            FileSet fs = (FileSet) filesets.get(i);
            if (fs.getProject() == null) {
                log("Deleting fileset with no project specified;"
                    + " assuming executing project", Project.MSG_VERBOSE);
                fs = (FileSet) fs.clone();
                fs.setProject(getProject());
            }
            final File fsDir = fs.getDir();
            if (!fs.getErrorOnMissingDir() &&
                (fsDir == null || !fsDir.exists())) {
                continue;
            }
            if (fsDir == null) {
                throw new BuildException(
                        "File or Resource without directory or file specified");
            } else if (!fsDir.isDirectory()) {
                handle("Directory does not exist: " + fsDir);
            } else {
                DirectoryScanner ds = fs.getDirectoryScanner();
                // the previous line has already scanned the
                // filesystem, in order to avoid a rescan when later
                // iterating, capture the results now and store them
                final String[] files = ds.getIncludedFiles();
                resourcesToDelete.add(new ResourceCollection() {
                        public boolean isFilesystemOnly() {
                            return true;
                        }
                        public int size() {
                            return files.length;
                        }
                        public Iterator<Resource> iterator() {
                            return new FileResourceIterator(getProject(),
                                                            fsDir, files);
                        }
                    });
                if (includeEmpty) {
                    filesetDirs.add(new ReverseDirs(getProject(), fsDir,
                                                    ds
                                                    .getIncludedDirectories()));
                }

                if (removeNotFollowedSymlinks) {
View Full Code Here

     * @since Ant 1.7
     */
    public void add(ResourceCollection c) {
        synchronized (this) {
            if (rc == null) {
                rc = new Resources();
                rc.setProject(getProject());
                rc.setCache(true);
            }
        }
        rc.add(c);
View Full Code Here

        getPath().add(rc);
    }

    private synchronized Resources getPath() {
        if (path == null) {
            path = new Resources(getProject());
            path.setCache(true);
        }
        return path;
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.resources.Resources$MyCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.