diff --git a/src/main/java/org/gcube/common/storagehubwrapper/server/converter/HLMapper.java b/src/main/java/org/gcube/common/storagehubwrapper/server/converter/HLMapper.java index a88cfe8..19cf3b9 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/converter/HLMapper.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/converter/HLMapper.java @@ -130,6 +130,9 @@ public class HLMapper { WorkspaceItemType type = null; boolean isFolder = false; + + String itemName = item.getName(); + //THE ITEM IS A KIND OF FOLDER if (item instanceof FolderItem){ isFolder = true; @@ -140,6 +143,7 @@ public class HLMapper { SharedFolder sharedfolder = (SharedFolder) item; //?? theItem = new WorkspaceSharedFolder(); type = WorkspaceItemType.SHARED_FOLDER; + itemName = sharedfolder.getTitle(); //IN CASE OF SHARED FOLDER THE NAME IS AN UUID, I'M USING THE TITLE if (sharedfolder.isVreFolder()){ VreFolder vreFolder = (VreFolder) item; theItem = new WorkspaceVREFolder(); @@ -147,7 +151,6 @@ public class HLMapper { type = WorkspaceItemType.VRE_FOLDER; } } - } //THE ITEM IS A KIND OF FILE @@ -215,7 +218,7 @@ public class HLMapper { type = WorkspaceItemType.TRASH_ITEM; theItem.setId(item.getId()); - theItem.setName(item.getName()); + theItem.setName(itemName); theItem.setPath(item.getPath()); theItem.setParentId(item.getParentId()); theItem.setTrashed(item.isTrashed()); diff --git a/src/main/java/org/gcube/common/storagehubwrapper/server/tohl/Workspace.java b/src/main/java/org/gcube/common/storagehubwrapper/server/tohl/Workspace.java index 00fd13b..17973d0 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/tohl/Workspace.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/tohl/Workspace.java @@ -201,6 +201,17 @@ public interface Workspace{ + /** + * Checks if is item shared. + * + * @param itemId the item id + * @return true, if is item shared + * @throws Exception the exception + */ + public boolean isItemShared(String itemId) throws Exception; + + + @@ -650,7 +661,7 @@ public interface Workspace{ * @throws InternalErrorException the internal error exception * @throws ItemAlreadyExistException the item already exist exception * @throws WrongDestinationException the wrong destination exception - * @throws InsufficientPrivilegesException + * @throws InsufficientPrivilegesException the insufficient privileges exception */ WorkspaceItem uploadArchive( String folderId, InputStream is, String extractionFolderName)