diff --git a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java index c7c2eae..1977305 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java @@ -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():"";