diff options
author | 2017-09-07 14:37:51 +0000 | |
---|---|---|
committer | 2017-09-07 14:37:51 +0000 | |
commit | 75c572279398dc2be7652263843c8802a9406c4f (patch) | |
tree | 6b4fb827b0f1f731efcdaf6e40a62814bc1e9928 /openecomp-be/api | |
parent | d8b91a969d1631793761cf1fdc17d52d4f82ca95 (diff) | |
parent | b7375b2488df93ba9df57ad13ec628bbff663819 (diff) |
Merge "Fixed a few static analysis violations"
Diffstat (limited to 'openecomp-be/api')
-rw-r--r-- | openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/errors/DefaultExceptionMapper.java | 18 |
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 |