浏览代码

[jasperserver axis] 新增文件时,对不支持的资源类型进行提示

sunyj 8 年之前
父节点
当前提交
1703c3fab9
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/main/java/com/uas/report/axis/ResourceHandlerRegistry.java

+ 5 - 2
src/main/java/com/uas/report/axis/ResourceHandlerRegistry.java

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