summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp
diff options
context:
space:
mode:
authorVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-09-07 14:37:51 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-07 14:37:51 +0000
commit75c572279398dc2be7652263843c8802a9406c4f (patch)
tree6b4fb827b0f1f731efcdaf6e40a62814bc1e9928 /openecomp-be/api/openecomp-sdc-rest-webapp
parentd8b91a969d1631793761cf1fdc17d52d4f82ca95 (diff)
parentb7375b2488df93ba9df57ad13ec628bbff663819 (diff)
Merge "Fixed a few static analysis violations"
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
index d399469745..2f6d298f01 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java
@@ -35,29 +35,25 @@ import org.openecomp.sdc.common.errors.ValidationErrorBuilder;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Path;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.ext.ExceptionMapper;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
public class DefaultExceptionMapper implements ExceptionMapper<Exception> {
private static final String ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE =
"errorCodesToResponseStatusMapping.json";
@SuppressWarnings("unchecked")
private static Map<String, String> errorCodeToResponseStatus =
- JsonUtil.json2Object(FileUtils
- .getFileInputStream(ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE), Map.class);
+ FileUtils.readViaInputStream(ERROR_CODES_TO_RESPONSE_STATUS_MAPPING_FILE,
+ stream -> JsonUtil.json2Object(stream, Map.class));
+
private static Logger logger = (Logger) LoggerFactory.getLogger(DefaultExceptionMapper.class);
@Override