diff options
author | 2021-03-22 15:33:06 +0000 | |
---|---|---|
committer | 2021-03-24 06:59:47 +0000 | |
commit | d378c37fbd1ecec7b43394926f1ca32a695e07de (patch) | |
tree | 5c8a085f8732f980d871d966ac49361644efa698 /openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services | |
parent | a6ae7294ecd336d7e88f915710b08e2658eaee00 (diff) |
Reformat openecomp-be
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Issue-ID: SDC-3449
Change-Id: I13e02322f8e00820cc5a1d85752caaeda9bf10d1
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services')
-rw-r--r-- | openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java index 1ece6f75f8..da604b7cb1 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java @@ -7,9 +7,9 @@ * 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. @@ -19,10 +19,12 @@ * Modifications copyright (c) 2019 Nokia * ================================================================================ */ - package org.openecomp.sdcrests.validation.rest.services; - +import java.io.IOException; +import java.io.InputStream; +import javax.inject.Named; +import javax.ws.rs.core.Response; import org.openecomp.sdc.validation.UploadValidationManager; import org.openecomp.sdc.validation.types.ValidationFileResponse; import org.openecomp.sdcrests.validation.rest.Validation; @@ -32,37 +34,28 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; -import javax.inject.Named; -import javax.ws.rs.core.Response; -import java.io.IOException; -import java.io.InputStream; - @Named @Service("validation") @Scope(value = "prototype") public class ValidationImpl implements Validation { - private final UploadValidationManager uploadValidationManager; - - @Autowired - public ValidationImpl(UploadValidationManager uploadValidationManager) { - this.uploadValidationManager = uploadValidationManager; - } + private final UploadValidationManager uploadValidationManager; - @Override - public Response validateFile(String type, InputStream fileToValidate) { - ValidationFileResponse validationFileResponse; - try { - validationFileResponse = uploadValidationManager.validateFile(type, fileToValidate); - } catch (IOException exception) { - throw new RuntimeException(exception); + @Autowired + public ValidationImpl(UploadValidationManager uploadValidationManager) { + this.uploadValidationManager = uploadValidationManager; } - ValidationFileResponseDto validationFileResponseDto = - new MapValidationFileResponseToValidationFileResponseDto() + @Override + public Response validateFile(String type, InputStream fileToValidate) { + ValidationFileResponse validationFileResponse; + try { + validationFileResponse = uploadValidationManager.validateFile(type, fileToValidate); + } catch (IOException exception) { + throw new RuntimeException(exception); + } + ValidationFileResponseDto validationFileResponseDto = new MapValidationFileResponseToValidationFileResponseDto() .applyMapping(validationFileResponse, ValidationFileResponseDto.class); - return Response.ok(validationFileResponseDto).build(); - } - - + return Response.ok(validationFileResponseDto).build(); + } } |