ref 11724: SAI - Update to StorageHUB

https://support.d4science.org/issues/11724

Updated to StorageHub 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@171662 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-09-25 09:54:13 +00:00
parent 789957b306
commit 5707c80e41
1 changed files with 4 additions and 1 deletions

View File

@ -202,6 +202,7 @@ public class FilesStorage {
Item item = items.get(0);
logger.debug("Item: " + item);
if (item != null) {
logger.debug("Item Id=" + item.getId());
OpenResolver openResolver = shc.open(item.getId());
FolderContainer folderContainer = openResolver.asFolder();
folderContainer.delete();
@ -287,6 +288,7 @@ public class FilesStorage {
Item item = items.get(0);
logger.debug("Item: " + item);
if (item != null) {
logger.debug("Item Id=" + item.getId());
ItemDescription itemDescription = new ItemDescription(item.getId(), item.getName(), item.getOwner(),
item.getPath(), item.getClass().getSimpleName());
@ -336,7 +338,6 @@ public class FilesStorage {
FileContainer fileContainer = folderContainer.uploadFile(inputStream,
STATISTICAL_ALGORITHM_PROJECT_FILE_NAME, STATISTICAL_ALGORITHM_PROJECT_FILE_DESCRIPTION);
logger.debug("Item updated: " + fileContainer.get().getId());
}
} catch (Throwable e) {
logger.error("Save project on workspace: " + e.getLocalizedMessage(), e);
@ -455,6 +456,7 @@ public class FilesStorage {
Item item = items.get(0);
logger.debug("Item: " + item);
if (item != null) {
logger.debug("Item Id=" + item.getId());
StreamDescriptor streamDescr = shc.open(item.getId()).asFile().download();
return streamDescr.getStream();
@ -495,6 +497,7 @@ public class FilesStorage {
Item item = items.get(0);
logger.debug("Item: " + item);
if (item != null) {
logger.debug("Item Id=" + item.getId());
return true;
} else {