X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=esr-mgr%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fesr%2Futil%2FRestResponseUtil.java;fp=esr-mgr%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faai%2Fesr%2Futil%2FRestResponseUtil.java;h=0000000000000000000000000000000000000000;hb=22a43294c389a413b7d8d372a6d267ea054b4e22;hp=3c27178c438570690c695d8cb5e9f98b9789489b;hpb=f860118c135ded9f97dbc9102c5d90f828fae34b;p=aai%2Fesr-server.git diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java b/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java deleted file mode 100644 index 3c27178..0000000 --- a/esr-mgr/src/main/java/org/onap/aai/esr/util/RestResponseUtil.java +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright 2016-2017 ZTE Corporation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onap.aai.esr.util; - -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -public class RestResponseUtil { - - /** - * get http success entity. - */ - public static Response getSuccessResponse(Object obj) { - if (obj != null) { - return Response.ok(obj).build(); - } else { - return Response.ok().build(); - } - } - - public static Response getCreateSussceeResponse(Object obj) { - return Response.status(Status.CREATED).entity(obj).build(); - } - - /** - * get http error entity. - */ - public static Response getErrorResponse(Object obj) { - if (obj != null) { - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(obj).build(); - } else { - return Response.serverError().build(); - } - - } -}