use of org.xwiki.resource.CreateResourceTypeException in project xwiki-platform by xwiki.
the class DefaultStringResourceTypeResolver method resolve.
@Override
public ResourceType resolve(String type, Map<String, Object> parameters) throws CreateResourceTypeException {
ResourceTypeResolver resolver;
DefaultParameterizedType parameterizedType = new DefaultParameterizedType(null, ResourceTypeResolver.class, String.class);
String hint = this.configuration.getURLFormatId();
if (this.componentManager.hasComponent(parameterizedType, hint)) {
try {
resolver = this.componentManager.getInstance(parameterizedType, hint);
} catch (ComponentLookupException e) {
throw new CreateResourceTypeException(String.format("Failed to convert Resource Type from String [%s] to [%s]", type, ResourceType.class.getSimpleName()), e);
}
} else {
// No specific String Resource Type Resolver for the Scheme URL, use the generic one!
resolver = this.genericResourceTypeResolver;
}
return resolver.resolve(type, parameters);
}
Aggregations