Jelajahi Sumber

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

sunyj 8 tahun lalu
induk
melakukan
1703c3fab9

+ 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);
 		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) {