@Override public String getReferencePath(final Resource<?> template) { WebResourcesFacet web = this.project.getFacet(WebResourcesFacet.class); for (DirectoryResource dir : web.getWebRootDirectories()) { if (ResourceUtil.isChildOf(dir, template)) { String relativePath = template.getFullyQualifiedName().substring(dir.getFullyQualifiedName().length()); return relativePath; } } throw new IllegalArgumentException("Not a valid template resource for this scaffold."); }
for (DirectoryResource dir : web.getWebRootDirectories()) if (ResourceUtil.isChildOf(dir, template))