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; }
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; }
private PathTraverser getPathTraverser() { return new PathTraverser(); }
private Collection<URI> collectOutputFiles() { return new PathTraverser().resolvePathes(Lists.newArrayList(outputClassDirectory.getAbsolutePath()), new ClassFileFilter()).values(); }