UriTemplate t = new PathTemplate(ar.getPath().getValue());
ensureTemplateUnused(t, ar, uriTemplatesUsed);
ResourceClass r = getResourceClass(ar);
rootResources.add(r.resource);
PathPattern p = new PathPattern(t);
rulesMap.put(p, new RightHandPathRule(
resourceConfig.getFeature(ResourceConfig.FEATURE_REDIRECT),
t.endsWithSlash(),
new ResourceObjectRule(t, o)));
}
for (Class<?> c : classes) {
AbstractResource ar = getAbstractResource(c);
if (!ar.isRootResource()) {
LOGGER.warning("The class, " + c + ", registered as a root resource class " +
"of the ResourceConfig is not a root resource class" +
". This class will be ignored");
continue;
}
// TODO this should be moved to the validation
// as such classes are not root resource classes
int modifiers = c.getModifiers();
if (Modifier.isAbstract(modifiers) && !Modifier.isInterface(modifiers)) {
LOGGER.warning("The " + c + ", registered as a root resource class " +
"of the ResourceConfig cannot be instantiated" +
". This class will be ignored");
continue;
} else if (Modifier.isInterface(modifiers)) {
LOGGER.warning("The " + c + ", registered as a root resource class " +
"of the ResourceConfig cannot be instantiated" +
". This interface will be ignored");
continue;
}
UriTemplate t = new PathTemplate(ar.getPath().getValue());
ensureTemplateUnused(t, ar, uriTemplatesUsed);
ResourceClass r = getResourceClass(ar);
rootResources.add(r.resource);
PathPattern p = new PathPattern(t);
rulesMap.put(p, new RightHandPathRule(