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

Examples of org.apache.tools.ant.types.resources.Restrict


   * Add a file set with classes that shall be exported.
   *
   * @param set The file set with exports to add.
   */
  public void addConfiguredExports(FileSet set) {
    final Restrict restrict = new Restrict();
    restrict.add(set);
    restrict.add(analyzeRestriction);
    exportsResourceCollections.add(restrict);
  }
View Full Code Here


   *
   * @param bcpt The bundle classpath that the bundle will have.
   */
  public void addConfiguredExportsBundleClasspath(BundleClasspathTask bcpt) {
    for (Iterator it = bcpt.getFileSets(failOnClassPath).iterator(); it.hasNext();) {
      final Restrict restrict = new Restrict();
      restrict.add((ResourceCollection) it.next());
      restrict.add(analyzeRestriction);
      exportsResourceCollections.add(restrict);
    }
  }
View Full Code Here

   * Add a file set with classes that are private to the bundles.
   *
   * @param set The file set with private implementations to add.
   */
  public void addConfiguredImpls(FileSet set) {
    final Restrict restrict = new Restrict();
    restrict.add(set);
    restrict.add(analyzeRestriction);
    implsResourceCollections.add(restrict);
  }
View Full Code Here

   *
   * @param bcpt The bundle classpath that the bundle will have.
   */
  public void addConfiguredImplsBundleClasspath(BundleClasspathTask bcpt) {
    for (Iterator it = bcpt.getFileSets(failOnClassPath).iterator(); it.hasNext();) {
      final Restrict restrict = new Restrict();
      restrict.add((ResourceCollection) it.next());
      restrict.add(analyzeRestriction);
      implsResourceCollections.add(restrict);
    }
  }
View Full Code Here

        log(newestSource.toLongString() + " is newest source", Project.MSG_VERBOSE);
        return oldestTarget.getLastModified() >= newestSource.getLastModified();
    }

    private void logFuture(ResourceCollection rc, ResourceSelector rsel) {
        Restrict r = new Restrict();
        r.add(rsel);
        r.add(rc);
        for (Iterator i = r.iterator(); i.hasNext();) {
            log("Warning: " + i.next() + " modified in the future.", Project.MSG_WARN);
        }
    }
View Full Code Here

            }
        }
        resourcesToDelete.add(filesetDirs);
        if (rcs != null) {
            // sort first to files, then dirs
            Restrict exists = new Restrict();
            exists.add(EXISTS);
            exists.add(rcs);
            Sort s = new Sort();
            s.add(REVERSE_FILESYSTEM);
            s.add(exists);
            resourcesToDelete.add(s);
        }
View Full Code Here

     */
    private ResourceCollection getResources() {
        if (rc == null) {
            return new StringResource(getProject(), textBuffer.toString());
        }
        Restrict noexistRc = new Restrict();
        noexistRc.add(NOT_EXISTS);
        noexistRc.add(rc);
        for (Iterator i = noexistRc.iterator(); i.hasNext();) {
            log(i.next() + " does not exist.", Project.MSG_ERR);
        }
        if (destinationFile != null) {
            for (Iterator i = rc.iterator(); i.hasNext();) {
                Object o = i.next();
                if (o instanceof FileResource) {
                    File f = ((FileResource) o).getFile();
                    if (FILE_UTILS.fileNameEquals(f, destinationFile)) {
                        throw new BuildException("Input file \""
                            + f + "\" is the same as the output file.");
                    }
                }
            }
        }
        Restrict result = new Restrict();
        result.add(EXISTS);
        result.add(rc);
        return result;
    }
View Full Code Here

        throws IOException {

        List/*<ResourceWithFlags>*/ l = new ArrayList/*<ResourceWithFlags>*/();
        ResourceCollectionFlags rcFlags = getFlags(target);

        Restrict res = new Restrict();
        res.setProject(getProject());
        res.add(target);

        Not not = new Not();
        Or or = new Or();
        not.add(or);
        for (Iterator i = src.iterator(); i.hasNext(); ) {
            ResourceWithFlags r = (ResourceWithFlags) i.next();
            Name name = new Name();
            name.setName(r.getName());
            or.add(name);
        }
        res.add(not);

        for (Iterator rs = res.iterator(); rs.hasNext(); ) {
            Resource r = (Resource) rs.next();
            String name = r.getName();
            if ("".equals(name) || "/".equals(name)) {
                continue;
            }
View Full Code Here

            for (int i = 0; i < targetnames.length; i++) {
                targetColl.add(targets.getResource(
                    targetnames[i].replace(File.separatorChar, '/')));
            }
            //find the out-of-date targets:
            Restrict r = new Restrict();
            r.add(selector.getTargetSelectorForSource(sr));
            r.add(targetColl);
            if (r.size() > 0) {
                result.add(sr);
                Resource t = (Resource) (r.iterator().next());
                logTo.log(sr.getName() + " added as " + t.getName()
                    + (t.isExists() ? " is outdated." : " doesn\'t exist."),
                    Project.MSG_VERBOSE);
                continue;
            }
View Full Code Here

                                  ResourceCollection rc, long granularity) {
        long now = System.currentTimeMillis() + granularity;
        Date sel = new Date();
        sel.setMillis(now);
        sel.setWhen(TimeComparison.AFTER);
        Restrict future = new Restrict();
        future.add(sel);
        future.add(rc);
        for (Iterator iter = future.iterator(); iter.hasNext();) {
            logTo.log("Warning: " + ((Resource) iter.next()).getName()
                     + " modified in the future.", Project.MSG_WARN);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.resources.Restrict

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.