@Override @Nonnull protected List<? extends ResourceFile> computeResults() { if (name != null) { if (name.contains("/")) { throw new IllegalArgumentException("relativePath: " + name); } final ResourceFile child = getChildrenMap().get(name); return (child != null) ? Collections.singletonList(child) : Collections.<ResourceFile>emptyList(); } // // FIXME: this reproduces the behaviour before the refactoring for NW-192 - but it's (and was) wrong // since it doesn't consider delegates. It should be rewritten by relying on getChildrenMap() and // making it eventually support recursion. // else if (recursive) { return delegate.findChildren().withRecursion(recursive).results(); } else { return new ArrayList<>(getChildrenMap().values()); } } };
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull protected List<? extends Type> computeResults() { final List<Type> result = new ArrayList<>(); for (final ResourceFile childFile : parentFile.findChildren().withRecursion(true).results()) { if (childFile.isFolder()) { try { final String relativeUri = childFile.getPath().relativeTo(resourceRootPath).urlDecoded().asString(); result.add(siteProvider.get().getSite().find(typeClass).withRelativePath(relativeUri).result()); } catch (NotFoundException e) { log.error("", e); } } } return result; }