URL urlatt = (URL) ccaps.get(0).getAttribute(ContentNamespace.CAPABILITY_URL_ATTRIBUTE);
if (urlatt == null || urlatt.toExternalForm().startsWith(getBaseURL().toExternalForm()) == false) {
ResourceBuilder builder = createResourceBuilder();
for (Capability cap : res.getCapabilities(null)) {
if (!ContentNamespace.CONTENT_NAMESPACE.equals(cap.getNamespace())) {
builder.addCapability(cap.getNamespace(), cap.getAttributes(), cap.getDirectives());
}
}
for (Capability cap : ccaps) {
ContentCapability ccap = cap.adapt(ContentCapability.class);
Map<String, Object> contentAtts = new HashMap<String, Object>();