Added the contentLenght and contentType parameters in the

ItemStreamDescription into downloadFile method
This commit is contained in:
francesco 2020-03-27 14:39:18 +01:00
parent 99da98151e
commit 284bdc20c8
1 changed files with 6 additions and 1 deletions

View File

@ -908,7 +908,12 @@ public final class WorkspaceStorageHubClientService implements Workspace{
try {
StreamDescriptor streamDesc = storageHubClientService.downloadFile(itemId, versionName, nodeIdsToExclude);
return new org.gcube.common.storagehubwrapper.shared.tohl.impl.StreamDescriptor(streamDesc.getStream(), streamDesc.getFileName(), null, null);
Long size = null;
if(streamDesc.getContentLenght()>0)
size = new Long(streamDesc.getContentLenght());
return new org.gcube.common.storagehubwrapper.shared.tohl.impl.StreamDescriptor(streamDesc.getStream(), streamDesc.getFileName(), size, streamDesc.getContentType());
} catch (Exception e) {
LOGGER.error("Error on downloading the file: "+fileName+ " with id: "+itemId, e);
String error = e.getMessage()!=null?e.getMessage():"";