Resolved conflicts while syncing with the master branch
This commit is contained in:
@@ -1805,6 +1805,7 @@ public class ApplicationEvaluationDao {
|
||||
.orElseThrow(() -> new ResourceNotFoundException(Status.NOT_FOUND,
|
||||
Translator.toLocale(GepafinConstant.APPLICATION_EVALUATION_NOT_FOUND)));
|
||||
}
|
||||
|
||||
public ApplicationEvaluationResponse updateApplicationEvaluation(
|
||||
Long assignedApplicationId,
|
||||
List<EvaluationDocumentRequest> docRequest) {
|
||||
|
||||
@@ -30,6 +30,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -118,12 +120,15 @@ public class AmazonS3ServiceImpl implements AmazonS3Service {
|
||||
public InputStream getFile(String s3Folder, String filePath) {
|
||||
try {
|
||||
String fileName = Utils.extractFileName(filePath);
|
||||
String path = s3Folder + "/" + fileName;
|
||||
// Decode the file name to handle special characters like '+' correctly
|
||||
String decodedFileName = URLDecoder.decode(fileName, StandardCharsets.UTF_8.toString());
|
||||
|
||||
String path = s3Folder + "/" + decodedFileName;
|
||||
GetObjectRequest getObjectRequest = new GetObjectRequest(bucketName, path);
|
||||
S3Object s3Object = amazonS3.getObject(getObjectRequest);
|
||||
log.info("File fetched successfully from Amazon S3: {}", fileName);
|
||||
return s3Object.getObjectContent();
|
||||
} catch (AmazonS3Exception e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Error occurred while getting file from Amazon S3: {}", e);
|
||||
throw new CustomValidationException(Status.VALIDATION_ERROR,
|
||||
Translator.toLocale(GepafinConstant.GET_ERROR_S3));
|
||||
|
||||
Reference in New Issue
Block a user