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

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


     * Add an arbitrary ResourceCollection.
     * @param c the ResourceCollection to add.
     * @since Ant 1.7
     */
    public void add(ResourceCollection c) {
        rc = rc == null ? new Resources() : rc;
        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;
        }
        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());
            }
            if (!fs.getDir().isDirectory()) {
                handle("Directory does not exist:" + fs.getDir());
            } else {
                resourcesToDelete.add(fs);
                if (includeEmpty) {
                    filesetDirs.add(new ReverseDirs(fs.getDir(), fs
                            .getDirectoryScanner().getIncludedDirectories()));
                }
            }
        }
        resourcesToDelete.add(filesetDirs);
View Full Code Here

 
  /**
   *
   */
  public JUnit4() {
    resources = new Resources();
  }
View Full Code Here

 
  /**
   *
   */
  public JUnit4() {
    resources = new Resources();
  }
View Full Code Here

 
  /**
   *
   */
  public JUnit4() {
    resources = new Resources();
  }
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 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);
        }

        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());
            }
            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 iterator() {
                            return new FileResourceIterator(getProject(),
                                                            fsDir, files);
                        }
                    });
                if (includeEmpty) {
                    filesetDirs.add(new ReverseDirs(getProject(), fsDir,
                                                    ds
                                                    .getIncludedDirectories()));
                }

                if (removeNotFollowedSymlinks) {
View Full Code Here

TOP

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

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.