|
@@ -52,12 +52,15 @@ public class ResourceHandlerRegistry {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public BasicResourceHandler getHandler(String wsType) {
|
|
|
|
|
|
|
+ public BasicResourceHandler getHandler(String wsType) throws WSException {
|
|
|
BasicResourceHandler handler = handlers.get(wsType);
|
|
BasicResourceHandler handler = handlers.get(wsType);
|
|
|
|
|
+ if (handler == null) {
|
|
|
|
|
+ throw new WSException(WSException.GENERAL_ERROR, "不支持该类型的资源!");
|
|
|
|
|
+ }
|
|
|
return handler;
|
|
return handler;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public BasicResourceHandler getHandler(Resource resource) {
|
|
|
|
|
|
|
+ public BasicResourceHandler getHandler(Resource resource) throws WSException {
|
|
|
String resourceType = resource.getResourceType();
|
|
String resourceType = resource.getResourceType();
|
|
|
String wsType = resourceTypes.get(resourceType);
|
|
String wsType = resourceTypes.get(resourceType);
|
|
|
if (wsType == null) {
|
|
if (wsType == null) {
|