Java 类org.gradle.api.internal.file.pattern.PatternMatcherFactory 实例源码

项目:Reer    文件:PatternSpecFactory.java   
protected Spec<FileTreeElement> createSpec(Collection<String> patterns, boolean include, boolean caseSensitive) {
    if (patterns.isEmpty()) {
        return include ? Specs.<FileTreeElement>satisfyAll() : Specs.<FileTreeElement>satisfyNone();
    }

    List<Spec<RelativePath>> matchers = new ArrayList<Spec<RelativePath>>(patterns.size());
    for (String pattern : patterns) {
        Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(include, caseSensitive, pattern);
        matchers.add(patternMatcher);
    }

    return new RelativePathSpec(Specs.union(matchers));
}
项目:Reer    文件:DefaultCopySpec.java   
public CopySpec filesMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action) {
    if (!patterns.iterator().hasNext()) {
        throw new InvalidUserDataException("must provide at least one pattern to match");
    }
    List<Spec> matchers = new ArrayList<Spec>();
    for (String pattern : patterns) {
        matchers.add(PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern));
    }
    Spec unionMatcher = Specs.union(matchers.toArray(new Spec[matchers.size()]));
    return eachFile(new MatchingCopyAction(unionMatcher, action));
}
项目:Reer    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action) {
    if (!patterns.iterator().hasNext()) {
        throw new InvalidUserDataException("must provide at least one pattern to not match");
    }
    List<Spec> matchers = new ArrayList<Spec>();
    for (String pattern : patterns) {
        matchers.add(PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern));
    }
    Spec unionMatcher = Specs.union(matchers.toArray(new Spec[matchers.size()]));
    return eachFile(new MatchingCopyAction(Specs.<RelativePath>negate(unionMatcher), action));
}
项目:intellij-ce-playground    文件:GradleResourceFileFilter.java   
private Spec<RelativePath> getAsExcludeSpec(boolean caseSensitive) {
  Collection<String> allExcludes = new LinkedHashSet<String>(myFilePattern.excludes);
  List<Spec<RelativePath>> matchers = new ArrayList<Spec<RelativePath>>();
  for (String exclude : allExcludes) {
    Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(false, caseSensitive, exclude);
    matchers.add(patternMatcher);
  }
  return Specs.or(false, matchers);
}
项目:intellij-ce-playground    文件:GradleResourceFileFilter.java   
private Spec<RelativePath> getAsIncludeSpec(boolean caseSensitive) {
  List<Spec<RelativePath>> matchers = new ArrayList<Spec<RelativePath>>();
  for (String include : myFilePattern.includes) {
    Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(true, caseSensitive, include);
    matchers.add(patternMatcher);
  }
  return Specs.or(true, matchers);
}
项目:Pushjet-Android    文件:PatternSet.java   
public Spec<FileTreeElement> getAsIncludeSpec() {
    List<Spec<FileTreeElement>> matchers = Lists.newArrayList();
    for (String include : includes) {
        Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(true, caseSensitive, include);
        matchers.add(new RelativePathSpec(patternMatcher));
    }

    matchers.addAll(includeSpecs);
    return new OrSpec<FileTreeElement>(matchers);
}
项目:Pushjet-Android    文件:PatternSet.java   
public Spec<FileTreeElement> getAsExcludeSpec() {
    Collection<String> allExcludes = Sets.newLinkedHashSet(excludes);
    Collections.addAll(allExcludes, DirectoryScanner.getDefaultExcludes());

    List<Spec<FileTreeElement>> matchers = Lists.newArrayList();
    for (String exclude : allExcludes) {
        Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(false, caseSensitive, exclude);
        matchers.add(new RelativePathSpec(patternMatcher));
    }

    matchers.addAll(excludeSpecs);
    return new OrSpec<FileTreeElement>(matchers);
}
项目:Pushjet-Android    文件:PatternSet.java   
public Spec<FileTreeElement> getAsIncludeSpec() {
    List<Spec<FileTreeElement>> matchers = Lists.newArrayList();
    for (String include : includes) {
        Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(true, caseSensitive, include);
        matchers.add(new RelativePathSpec(patternMatcher));
    }

    matchers.addAll(includeSpecs);
    return new OrSpec<FileTreeElement>(matchers);
}
项目:Pushjet-Android    文件:PatternSet.java   
public Spec<FileTreeElement> getAsExcludeSpec() {
    Collection<String> allExcludes = Sets.newLinkedHashSet(excludes);
    Collections.addAll(allExcludes, DirectoryScanner.getDefaultExcludes());

    List<Spec<FileTreeElement>> matchers = Lists.newArrayList();
    for (String exclude : allExcludes) {
        Spec<RelativePath> patternMatcher = PatternMatcherFactory.getPatternMatcher(false, caseSensitive, exclude);
        matchers.add(new RelativePathSpec(patternMatcher));
    }

    matchers.addAll(excludeSpecs);
    return new OrSpec<FileTreeElement>(matchers);
}
项目:Reer    文件:DefaultCopySpec.java   
public CopySpec filesMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(new MatchingCopyAction(matcher, action));
}
项目:Reer    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(new MatchingCopyAction(Specs.<RelativePath>negate(matcher), action));
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(matcher, action));
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(new NotSpec<RelativePath>(matcher), action));
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(matcher, action));
}
项目:Pushjet-Android    文件:DefaultCopySpec.java   
public CopySpec filesNotMatching(String pattern, Action<? super FileCopyDetails> action) {
    Spec<RelativePath> matcher = PatternMatcherFactory.getPatternMatcher(true, isCaseSensitive(), pattern);
    return eachFile(
            new MatchingCopyAction(new NotSpec<RelativePath>(matcher), action));
}