Added the contentLenght and contentType parameters in the
ItemStreamDescription into downloadFile method
This commit is contained in:
parent
99da98151e
commit
284bdc20c8
|
@ -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():"";
|
||||
|
|
Loading…
Reference in New Issue