Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug/vas-11487: fix download bug #1379

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,15 @@ public ResponseEntity<ResultsDto> findObjectById(final @PathVariable("id") Strin
public ResponseEntity<Resource> downloadObjectFromUnit(final @PathVariable("id") String id,
@QueryParam("qualifier") String qualifier,
@QueryParam("version") Integer version,
@QueryParam("tenantId") Integer tenantId,
@QueryParam("contractId") String contractId) throws PreconditionFailedException,
@QueryParam("tenantId") Integer tenantId) throws PreconditionFailedException,
InvalidParseOperationException {
ParameterChecker.checkParameter("The Identifier, The contractId and The tenantId are mandatory parameters: ",
id, contractId, String.valueOf(tenantId));
SanityChecker.checkSecureParameter(id, contractId, String.valueOf(tenantId));
ParameterChecker.checkParameter("The Identifier and The tenantId are mandatory parameters: ",
id, String.valueOf(tenantId));
SanityChecker.checkSecureParameter(id, String.valueOf(tenantId));
LOGGER.debug("Download the Archive Unit Object with ID {}", id);
ObjectData objectData = new ObjectData();
ResponseEntity<Resource> responseResource = archivesSearchService.downloadObjectFromUnit(id, qualifier, version,
objectData, buildUiHttpContext(tenantId, contractId)).block();
objectData, buildUiHttpContext(tenantId)).block();
List<String> headersValuesContentDispo = responseResource.getHeaders().get(CONTENT_DISPOSITION);
LOGGER.info("Content-Disposition value is {} ", headersValuesContentDispo);
String fileNameHeader = isNotEmpty(objectData.getFilename())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,15 @@ public ResponseEntity<Resource> downloadObjectFromUnit(
@QueryParam("objectId") String objectId,
@QueryParam("tenantId") Integer tenantId,
@QueryParam("qualifier") String qualifier,
@QueryParam("version") Integer version,
@QueryParam("contractId") String contractId) throws PreconditionFailedException,
@QueryParam("version") Integer version) throws PreconditionFailedException,
InvalidParseOperationException {
ParameterChecker.checkParameter("The Identifier, The contractId and The tenantId are mandatory parameters: ",
unitId, objectId, contractId, String.valueOf(tenantId));
SanityChecker.checkSecureParameter(unitId, contractId, objectId);
ParameterChecker.checkParameter("The Identifier, and The tenantId are mandatory parameters: ",
unitId, objectId, String.valueOf(tenantId));
SanityChecker.checkSecureParameter(unitId, objectId);
LOGGER.debug("Download the Archive Unit Object with Unit ID {}", unitId);
final ObjectData objectData = new ObjectData();
ResponseEntity<Resource> responseResource = projectObjectGroupService.downloadObjectFromUnit(unitId, objectId,
qualifier, version, objectData, buildUiHttpContext(tenantId, contractId)).block();
qualifier, version, objectData, buildUiHttpContext(tenantId)).block();
List<String> headersValuesContentDispo = responseResource.getHeaders().get(CONTENT_DISPOSITION);
LOGGER.info("Content-Disposition value is {} ", headersValuesContentDispo);
String fileNameHeader = isNotEmpty(objectData.getFilename())
Expand Down