From 4779c04a249b7e69d7c88da9d3121b023119f8b7 Mon Sep 17 00:00:00 2001 From: francesco Date: Thu, 12 Mar 2020 10:19:36 +0100 Subject: [PATCH] Added to Workspace Interface the methods 'find' and 'search' --- .../server/StorageHubClientService.java | 41 ++ .../WorkspaceStorageHubClientService.java | 437 +++++++++++++++++- .../server/tohl/Workspace.java | 18 + 3 files changed, 495 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java index d5355bc..83a6353 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java @@ -38,6 +38,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +// TODO: Auto-generated Javadoc /** * The Class StorageHubClientService. * @@ -47,10 +48,19 @@ import org.slf4j.LoggerFactory; public class StorageHubClientService { + /** The logger. */ private static Logger logger = LoggerFactory.getLogger(StorageHubClientService.class); + + /** The Constant ACCOUNTING_HL_NODE_NAME. */ public static final String ACCOUNTING_HL_NODE_NAME = "hl:accounting"; + + /** The scope. */ private String scope; + + /** The authorization token. */ private String authorizationToken; + + /** The shc client. */ private StorageHubClient shcClient; @@ -551,6 +561,32 @@ public class StorageHubClientService { throw new ItemNotFoundException(e.getMessage()); } + if(item instanceof FolderItem || item instanceof SharedFolder || item instanceof VreFolder){ + return shcClient.open(folderId).asFolder().findByName(name).withContent().getItems(); + }else + throw new Exception("The input folder id is not a folder"); + } + + + + /** + * Search by text. + * + * @param name the name + * @param folderId the folder id + * @return the list + * @throws Exception the exception + */ + public List searchByText(String name, String folderId) throws Exception { + + Item item; + try { + item = getItem(folderId, false, true); + }catch (Exception e) { + logger.error("Error during get item with id: "+folderId,e); + throw new ItemNotFoundException(e.getMessage()); + } + if(item instanceof FolderItem || item instanceof SharedFolder || item instanceof VreFolder){ //return shcClient.open(folderId).asFolder().findByName(name).withContent().getItems(); return shcClient.open(folderId).asFolder().search(name).withContent().getItems(); @@ -884,6 +920,11 @@ public class StorageHubClientService { + /** + * To string. + * + * @return the string + */ /* (non-Javadoc) * @see java.lang.Object#toString() */ 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 6b0cb4b..a59d4fe 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java @@ -46,6 +46,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +// TODO: Auto-generated Javadoc /** * The Class WorkspaceStorageHubClientService. * @@ -54,13 +55,23 @@ import org.slf4j.LoggerFactory; */ public final class WorkspaceStorageHubClientService implements Workspace{ + /** The logger. */ //public static final String ACCOUNTING_HL_NODE_NAME = "hl:accounting"; private static Logger LOGGER = LoggerFactory.getLogger(WorkspaceStorageHubClientService.class); + + /** The storage hub client service. */ private StorageHubClientService storageHubClientService; + + /** The with accounting. */ private boolean withAccounting; + + /** The with file details. */ private boolean withFileDetails; + + /** The with map properties. */ private boolean withMapProperties; + /** The workspace root. */ private WorkspaceFolder workspaceRoot = null; /** @@ -144,9 +155,17 @@ public final class WorkspaceStorageHubClientService implements Workspace{ * Jun 22, 2018 */ public static class WorkspaceStorageHubClientServiceBuilder{ + + /** The storage hub client service. */ private StorageHubClientService storageHubClientService; + + /** The with accounting. */ private boolean withAccounting; + + /** The with file details. */ private boolean withFileDetails; + + /** The with map properties. */ private boolean withMapProperties; /** @@ -232,6 +251,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the owner. + * + * @return the owner + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getOwner() */ @@ -244,6 +270,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return root.getOwner(); } + /** + * Gets the root. + * + * @return the root + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getRoot() */ @@ -290,6 +323,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the children. + * + * @param id the id + * @return the children + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.tohl.Workspace#getChildren(java.lang.String) */ @@ -308,6 +348,14 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return toChildren; } + /** + * Gets the filtered children. + * + * @param id the id + * @param aType the a type + * @return the filtered children + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.tohl.Workspace#getChildren(java.lang.String) */ @@ -326,6 +374,14 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return toChildren; } + /** + * Gets the parents by id. + * + * @param id the id + * @return the parents by id + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getParentsById(java.lang.String) */ @@ -347,6 +403,20 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return toParents; } + /** + * Creates the folder. + * + * @param name the name + * @param description the description + * @param destinationFolderId the destination folder id + * @return the workspace folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createFolder(java.lang.String, java.lang.String, java.lang.String) */ @@ -373,6 +443,15 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the item. + * + * @param itemId the item id + * @return the item + * @throws ItemNotFoundException the item not found exception + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getItem(java.lang.String) */ @@ -382,6 +461,18 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return getItem(itemId, withAccounting, withFileDetails, withMapProperties); } + /** + * Gets the item. + * + * @param itemId the item id + * @param withAccounting the with accounting + * @param withFileDetails the with file details + * @param withMapProperties the with map properties + * @return the item + * @throws ItemNotFoundException the item not found exception + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.server.tohl.Workspace#getItem(java.lang.String, boolean, boolean, boolean) */ @@ -407,6 +498,21 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Creates the folder. + * + * @param name the name + * @param description the description + * @param destinationFolderId the destination folder id + * @param properties the properties + * @return the workspace folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createFolder(java.lang.String, java.lang.String, java.lang.String, java.util.Map) */ @@ -423,6 +529,16 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return folder; } + /** + * Upload file. + * + * @param folderId the folder id + * @param is the is + * @param fileName the file name + * @param fileDescription the file description + * @return the workspace item + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.server.tohl.Workspace#uploadFile(java.lang.String, java.io.InputStream, java.lang.String, java.lang.String) */ @@ -448,6 +564,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ + /** + * Gets the shared folder members. + * + * @param folderId the folder id + * @return the shared folder members + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.server.tohl.Workspace#getSharedFolderMembers(java.lang.String) */ @@ -464,6 +587,16 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } } + /** + * Exists. + * + * @param name the name + * @param folderId the folder id + * @return true, if successful + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + * @throws WrongItemTypeException the wrong item type exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#exists(java.lang.String, java.lang.String) */ @@ -478,6 +611,16 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return foundItems!=null && foundItems.size()>0?true:false; } + /** + * Find. + * + * @param name the name + * @param folderId the folder id + * @return the list + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + * @throws WrongItemTypeException the wrong item type exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#find(java.lang.String, java.lang.String) */ @@ -500,7 +643,42 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return wsItems; } catch (Exception e) { - LOGGER.error("Error during search items with name "+name+" in the parent id: "+folderId, e); + LOGGER.error("Error during find items with name "+name+" in the parent folder id: "+folderId, e); + throw new InternalErrorException(e.getMessage()); + } + } + + + /** + * Search. + * + * @param text the text + * @param folderId the folder id where searching + * @return the list + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + * @throws WrongItemTypeException the wrong item type exception + */ + @Override + public List search(String text, String folderId) + throws InternalErrorException, ItemNotFoundException, + WrongItemTypeException { + + LOGGER.debug("called text"); + Validate.notNull(folderId,"The input folderid is null"); + try { + List items = storageHubClientService.searchByText(text, folderId); + List wsItems = null; + if(items!=null){ + wsItems = new ArrayList(items.size()); + for (Item item : items) { + wsItems.add(HLMapper.toWorkspaceItem(item)); + } + } + return wsItems; + } + catch (Exception e) { + LOGGER.error("Error during search items with text "+text+" in the parent folder id: "+folderId, e); throw new InternalErrorException(e.getMessage()); } } @@ -529,6 +707,12 @@ public final class WorkspaceStorageHubClientService implements Workspace{ + /** + * Delete item. + * + * @param itemId the item id + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#removeItem(java.lang.String) */ @@ -548,6 +732,15 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } } + /** + * Removes the items. + * + * @param id the id + * @return the map + * @throws ItemNotFoundException the item not found exception + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#removeItems(java.lang.String[]) */ @@ -569,6 +762,15 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return errors; } + /** + * Upload archive. + * + * @param folderId the folder id + * @param is the is + * @param extractionFolderName the extraction folder name + * @return the workspace item + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#uploadArchive(java.lang.String, java.io.InputStream, java.lang.String) */ @@ -628,6 +830,12 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the trash. + * + * @return the trash + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#getTrash() */ @@ -661,6 +869,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Restore thrash item. + * + * @param itemId the item id + * @return the workspace item + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#restoreThrashItem(java.lang.String) */ @@ -727,6 +942,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ + /** + * Move items. + * + * @param itemIds the item ids + * @param folderDestinationId the folder destination id + * @return the list + * @throws ItemNotFoundException the item not found exception + * @throws WrongDestinationException the wrong destination exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws InternalErrorException the internal error exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#moveItems(java.util.List, java.lang.String) */ @@ -766,6 +994,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Copy file items. + * + * @param itemIds the item ids + * @param folderDestinationId the folder destination id + * @return the list + * @throws ItemNotFoundException the item not found exception + * @throws WrongDestinationException the wrong destination exception + * @throws InternalErrorException the internal error exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#copyFileItems(java.util.List, java.lang.String) */ @@ -805,6 +1046,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Copy file. + * + * @param itemId the item id + * @param folderDestinationId the folder destination id + * @return the workspace item + * @throws ItemNotFoundException the item not found exception + * @throws WrongDestinationException the wrong destination exception + * @throws InternalErrorException the internal error exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#copyFile(java.lang.String, java.lang.String) */ @@ -817,6 +1071,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Move item. + * + * @param itemId the item id + * @param folderDestinationId the folder destination id + * @return the workspace item + * @throws ItemNotFoundException the item not found exception + * @throws WrongDestinationException the wrong destination exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws InternalErrorException the internal error exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#moveItem(java.lang.String, java.lang.String) */ @@ -829,6 +1096,18 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Rename item. + * + * @param itemId the item id + * @param newName the new name + * @return the workspace item + * @throws ItemNotFoundException the item not found exception + * @throws InternalErrorException the internal error exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#renameItem(java.lang.String, java.lang.String) */ @@ -923,6 +1202,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the thumbnail data. + * + * @param itemId the item id + * @return the thumbnail data + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#getThumbnailData(java.lang.String) */ @@ -943,6 +1229,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the metadata. + * + * @param itemId the item id + * @return the metadata + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#getMetadata(java.lang.String) */ @@ -1034,6 +1327,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Update metadata. + * + * @param itemId the item id + * @param mapObjs the map objs + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#updateMetadata(java.lang.String, java.util.Map) */ @@ -1049,6 +1349,16 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Creates the URL. + * + * @param fileName the file name + * @param fileDescription the file description + * @param url the url + * @param destinationFolderId the destination folder id + * @return the URL item + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createExternalUrl(java.lang.String, java.lang.String, java.lang.String, java.lang.String) */ @@ -1073,6 +1383,14 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Sets the folder as public. + * + * @param folderId the folder id + * @param setPublic the set public + * @return true, if successful + * @throws Exception the exception + */ /* (non-Javadoc) * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#setFolderAsPublic(java.lang.String, boolean) */ @@ -1204,6 +1522,14 @@ public final class WorkspaceStorageHubClientService implements Workspace{ + /** + * Change description. + * + * @param itemId the item id + * @param newDescription the new description + * @throws ItemNotFoundException the item not found exception + * @throws InternalErrorException the internal error exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#changeDescription(java.lang.String, java.lang.String) */ @@ -1216,6 +1542,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Search by mime type. + * + * @param mimeType the mime type + * @return the list + * @throws InternalErrorException the internal error exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#searchByMimeType(java.lang.String) */ @@ -1227,6 +1560,21 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Creates the shared folder. + * + * @param name the name + * @param description the description + * @param users the users + * @param destinationFolderId the destination folder id + * @return the workspace shared folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createSharedFolder(java.lang.String, java.lang.String, java.util.List, java.lang.String) */ @@ -1242,6 +1590,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Share folder. + * + * @param users the users + * @param destinationFolderId the destination folder id + * @return the workspace shared folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#shareFolder(java.util.List, java.lang.String) */ @@ -1256,6 +1617,19 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Share. + * + * @param users the users + * @param itemId the item id + * @return the workspace shared folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#share(java.util.List, java.lang.String) */ @@ -1269,6 +1643,24 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Creates the gcube item. + * + * @param name the name + * @param description the description + * @param scopes the scopes + * @param creator the creator + * @param itemType the item type + * @param properties the properties + * @param destinationFolderId the destination folder id + * @return the workspace item + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + * @throws InternalErrorException the internal error exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createGcubeItem(java.lang.String, java.lang.String, java.util.List, java.lang.String, java.lang.String, java.util.Map, java.lang.String) */ @@ -1286,6 +1678,14 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Unshare. + * + * @param itemId the item id + * @return the workspace item + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#unshare(java.lang.String) */ @@ -1298,6 +1698,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the my special folders. + * + * @return the my special folders + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getMySpecialFolders() */ @@ -1309,6 +1716,13 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Search by properties. + * + * @param properties the properties + * @return the list + * @throws InternalErrorException the internal error exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#searchByProperties(java.util.List) */ @@ -1320,6 +1734,21 @@ public final class WorkspaceStorageHubClientService implements Workspace{ return null; } + /** + * Creates the VRE folder. + * + * @param scope the scope + * @param description the description + * @param displayName the display name + * @param privilege the privilege + * @return the workspace VRE folder + * @throws InternalErrorException the internal error exception + * @throws InsufficientPrivilegesException the insufficient privileges exception + * @throws ItemAlreadyExistException the item already exist exception + * @throws WrongDestinationException the wrong destination exception + * @throws ItemNotFoundException the item not found exception + * @throws WorkspaceFolderNotFoundException the workspace folder not found exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#createVREFolder(java.lang.String, java.lang.String, java.lang.String, org.gcube.portal.storagehubwrapper.shared.ACLType) */ @@ -1335,6 +1764,12 @@ public final class WorkspaceStorageHubClientService implements Workspace{ } + /** + * Gets the public folders. + * + * @return the public folders + * @throws InternalErrorException the internal error exception + */ /* (non-Javadoc) * @see org.gcube.portal.storagehubwrapper.shared.Workspace#getPublicFolders() */ 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 2d1185a..a530a54 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 @@ -29,6 +29,7 @@ import org.gcube.common.storagehubwrapper.shared.tohl.items.URLItem; +// TODO: Auto-generated Javadoc /** * The Interface Workspace. * @@ -497,6 +498,21 @@ public interface Workspace{ * @throws Exception the exception */ boolean canUserWriteIntoFolder(String folderId) throws Exception; + + + + /** + * Search. + * + * @param text the text + * @param folderId the folder id + * @return the list + * @throws InternalErrorException the internal error exception + * @throws ItemNotFoundException the item not found exception + * @throws WrongItemTypeException the wrong item type exception + */ + List search(String text, String folderId) + throws InternalErrorException, ItemNotFoundException, WrongItemTypeException; /* * @@ -794,4 +810,6 @@ public interface Workspace{ + + }