RED-6864 - Fix compile issue
This commit is contained in:
parent
d4e1677eab
commit
bf3a790e7b
@ -6,13 +6,12 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.service.FeignExceptionHandler.processFeignException;
|
||||
import static com.iqser.red.service.persistence.management.v1.processor.utils.DownloadBufferUtils.fileProxyStreamForDownload;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
@ -123,7 +122,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
var file = fileStatusManagementService.getFileStatus(fileId);
|
||||
var untouchedFileStream = fileManagementStorageService.getObject(TenantContext.getTenantId(), StorageIdUtils.getStorageId(dossierId, fileId, FileType.ORIGIN));
|
||||
return getResponseEntity(inline, untouchedFileStream, file.getFilename(), MediaType.APPLICATION_PDF);
|
||||
return getResponseEntity(inline, untouchedFileStream, file.getFilename());
|
||||
} catch (FeignException e) {
|
||||
if (e.status() == HttpStatus.NOT_FOUND.value()) {
|
||||
return new ResponseEntity<>(e.getMessage(), HttpStatus.NOT_FOUND);
|
||||
@ -135,10 +134,10 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
private ResponseEntity<?> getResponseEntity(boolean inline, FileInputStream resource, String filename, MediaType mediaType) {
|
||||
private ResponseEntity<?> getResponseEntity(boolean inline, InputStream resource, String filename) {
|
||||
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
httpHeaders.setContentType(mediaType);
|
||||
httpHeaders.setContentType(MediaType.APPLICATION_PDF);
|
||||
|
||||
if (filename != null) {
|
||||
httpHeaders.add(DOWNLOAD_HEADER_NAME, inline ? "inline" : "attachment" + "; filename*=utf-8''" + StringEncodingUtils.urlEncode(filename));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user