summaryrefslogtreecommitdiffstats
path: root/vnfmarket-be/vnf-sdk-marketplace/src
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-09-20 14:48:48 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-09-20 14:51:23 +0800
commit7f69ec6bacd6df23e1ad2083dbc33e92d66d7ae0 (patch)
treee41088e67e787cd05e2da55e6c057e7cf8e86546 /vnfmarket-be/vnf-sdk-marketplace/src
parent2e5bd91b384e365a7e8e6c2efa25b293f2f0bcc6 (diff)
throw dedicated exception
critical: L74 L136 L195 Change-Id: I114114950858d90a15f930268e27a350a0fac99a Signed-off-by: Harry Huang <huangxiangyu5@huawei.com> Issue-Id: VNFSDK-85
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src')
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java
index 7ad48c61..7e50eab8 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/resource/PackageResource.java
@@ -15,6 +15,7 @@
*/
package org.onap.vnfsdk.marketplace.resource;
+import java.io.IOException;
import java.io.InputStream;
import javax.servlet.http.HttpServletRequest;
@@ -34,6 +35,7 @@ import javax.ws.rs.core.Response;
import org.eclipse.jetty.http.HttpStatus;
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
import org.glassfish.jersey.media.multipart.FormDataParam;
+import org.onap.vnfsdk.marketplace.db.exception.MarketplaceResourceException;
import org.onap.vnfsdk.marketplace.entity.response.CsarFileUriResponse;
import org.onap.vnfsdk.marketplace.entity.response.PackageMeta;
import org.onap.vnfsdk.marketplace.entity.response.UploadPackageResponse;
@@ -48,9 +50,9 @@ import io.swagger.annotations.ApiResponses;
/**
* csar package service.
- *
+ *
* @author 10189609
- *
+ *
*/
@Path("/PackageResource")
@Api(tags = {"Package Resource"})
@@ -71,7 +73,7 @@ public class PackageResource {
public Response updateValidateStatus(
@ApiParam(value = "http request body") @Context HttpServletRequest request,
@ApiParam(value = "http header") @Context HttpHeaders head
- ) throws Exception {
+ ) throws IOException {
InputStream input = request.getInputStream();
return PackageWrapper.getInstance().updateValidateStatus(input);
@@ -133,7 +135,7 @@ public class PackageResource {
required = true) @FormDataParam("file") InputStream uploadedInputStream,@FormDataParam("params") String details,
@ApiParam(value = "file detail",
required = false) @FormDataParam("file") FormDataContentDisposition fileDetail,
- @ApiParam(value = "http header") @Context HttpHeaders head) throws Exception {
+ @ApiParam(value = "http header") @Context HttpHeaders head) throws IOException, MarketplaceResourceException {
return PackageWrapper.getInstance().uploadPackage(uploadedInputStream, fileDetail, details, head);
}
@@ -192,16 +194,16 @@ public class PackageResource {
required = true) @FormDataParam("file") InputStream uploadedInputStream,@FormDataParam("params") String details,
@ApiParam(value = "file detail",
required = false) @FormDataParam("file") FormDataContentDisposition fileDetail,
- @ApiParam(value = "http header") @Context HttpHeaders head) throws Exception {
+ @ApiParam(value = "http header") @Context HttpHeaders head) throws IOException, MarketplaceResourceException {
return PackageWrapper.getInstance().reUploadPackage(csarId,uploadedInputStream, fileDetail, details, head);
- }
+ }
@Path("/csars/{csarId}/onboardstatus")
@GET
@ApiOperation(value="Get VNF OnBoarding Result", response=OnBoardingResult.class)
@Produces(MediaType.APPLICATION_JSON)
- public Response getOnBoardingResult(@ApiParam("csar Id") @PathParam("csarId") String csarId,
- @ApiParam("operation type") @QueryParam("operTypeId") String operTypeId,
+ public Response getOnBoardingResult(@ApiParam("csar Id") @PathParam("csarId") String csarId,
+ @ApiParam("operation type") @QueryParam("operTypeId") String operTypeId,
@ApiParam("operation id") @QueryParam("operId") String operId)
{
return PackageWrapper.getInstance().getOnBoardingResult(csarId, operTypeId, operId);
@@ -225,3 +227,4 @@ public class PackageResource {
return PackageWrapper.getInstance().getOnBoardingSteps();
}
}
+