ref #11879: TDM - Update to StorageHUB

https://support.d4science.org/issues/#11879

Updated to StorageHub



git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@171469 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-09-14 14:04:00 +00:00
parent 2e00334667
commit bf57479c64
1 changed files with 4 additions and 1 deletions

View File

@ -246,7 +246,10 @@ public class FilesStorage {
IClient client = new StorageClient(user, AccessType.PUBLIC, MemoryType.VOLATILE).getClient();
try (InputStream is = client.get().RFileAsInputStream(storageId)) {
if(is==null){
logger.error("Error in storage input stream is null for storageId :"+storageId);
throw new TDGWTServiceException("Error in storage input stream is null for storageId :"+storageId);
}
StorageHubClient shc = new StorageHubClient();
FolderContainer folderContainer = shc.open(folderId).asFolder();
FileContainer fileContainer = folderContainer.uploadFile(is, name, description);