Java 类org.eclipse.xtext.mwe.PathTraverser 实例源码

项目:xtext-extras    文件:StandaloneBuilder.java   
protected List<URI> collectResources(final Iterable<String> roots, final ResourceSet resourceSet) {
  final String extensions = IterableExtensions.join(this.languages.keySet(), "|");
  final NameBasedFilter nameBasedFilter = new NameBasedFilter();
  nameBasedFilter.setRegularExpression(((".*\\.(?:(" + extensions) + "))$"));
  final List<URI> resources = CollectionLiterals.<URI>newArrayList();
  final Predicate<URI> _function = (URI input) -> {
    final boolean matches = nameBasedFilter.matches(input);
    if (matches) {
      this.forceDebugLog((("Adding file \'" + input) + "\'"));
      resources.add(input);
    }
    return matches;
  };
  final Multimap<String, URI> modelsFound = new PathTraverser().resolvePathes(
    IterableExtensions.<String>toList(roots), _function);
  final BiConsumer<String, Collection<URI>> _function_1 = (String uri, Collection<URI> resource) -> {
    final File file = new File(uri);
    if ((((resource != null) && (!file.isDirectory())) && file.getName().endsWith(".jar"))) {
      this.registerBundle(file);
    }
  };
  modelsFound.asMap().forEach(_function_1);
  return resources;
}
项目:xtext-extras    文件:EclipseJavaCompiler.java   
private boolean containsJavaFiles(Iterable<String> roots) {
    final String javaExt = "java";
    Multimap<String, URI> uris = new PathTraverser().resolvePathes(Lists.newArrayList(roots), new Predicate<URI>() {
        @Override
        public boolean apply(URI input) {
            return javaExt.equals(input.fileExtension());
        }
    });
    return uris.values().size() > 0;
}
项目:n4js    文件:XcoreReader.java   
private PathTraverser getPathTraverser() {
    return new PathTraverser();
}
项目:xtext-extras    文件:TestEclipseCompiler.java   
private Collection<URI> collectOutputFiles() {
    return new PathTraverser().resolvePathes(Lists.newArrayList(outputClassDirectory.getAbsolutePath()),
            new ClassFileFilter()).values();
}