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 e491a76..5d03dd7 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java @@ -428,9 +428,7 @@ public final class WorkspaceStorageHubClientService implements Workspace{ @Override public WorkspaceItem uploadFile( String folderId, InputStream is, String fileName, String fileDescription) - throws InsufficientPrivilegesException, - WorkspaceFolderNotFoundException, InternalErrorException, - ItemAlreadyExistException, WrongDestinationException { + throws Exception { WorkspaceItem wsItem = null; try { @@ -438,10 +436,8 @@ public final class WorkspaceStorageHubClientService implements Workspace{ wsItem = HLMapper.toWorkspaceItem(item); } catch (Exception e) { - LOGGER.error("Error during uploading the file: "+fileName+" in the folderId: "+folderId, e); - String error = e.getMessage()!=null?e.getMessage():""; - throw new InternalErrorException("Error during uploading the file: "+fileName+". "+error); - + LOGGER.error("Error uploading the file: "+fileName+" in the folderId: "+folderId, e); + throw e; } return wsItem; 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 24899d5..a7c7ba5 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 @@ -149,14 +149,10 @@ public interface Workspace{ * @param inputStream the input stream * @param fileName the file name * @param fileDescription the file description - * @return the 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 + * @return the workspace item + * @throws Exception the exception */ - public WorkspaceItem uploadFile(String folderId, InputStream inputStream, String fileName, String fileDescription) throws InsufficientPrivilegesException, WorkspaceFolderNotFoundException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException; + public WorkspaceItem uploadFile(String folderId, InputStream inputStream, String fileName, String fileDescription) throws Exception; /** * Gets the shared folder members. @@ -288,7 +284,7 @@ public interface Workspace{ public URL getPublicLinkForFile(String fileItemId) throws Exception; /** - * Gets the public link of the file at the input version + * Gets the public link of the file at the input version. * * @param fileItemId the file item id * @param version the version