added only the general Exception to catch error on method uploadFile
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@179245 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
48c7fdaa9c
commit
7863c45c90
|
@ -428,9 +428,7 @@ public final class WorkspaceStorageHubClientService implements Workspace{
|
||||||
@Override
|
@Override
|
||||||
public WorkspaceItem uploadFile(
|
public WorkspaceItem uploadFile(
|
||||||
String folderId, InputStream is, String fileName, String fileDescription)
|
String folderId, InputStream is, String fileName, String fileDescription)
|
||||||
throws InsufficientPrivilegesException,
|
throws Exception {
|
||||||
WorkspaceFolderNotFoundException, InternalErrorException,
|
|
||||||
ItemAlreadyExistException, WrongDestinationException {
|
|
||||||
|
|
||||||
WorkspaceItem wsItem = null;
|
WorkspaceItem wsItem = null;
|
||||||
try {
|
try {
|
||||||
|
@ -438,10 +436,8 @@ public final class WorkspaceStorageHubClientService implements Workspace{
|
||||||
wsItem = HLMapper.toWorkspaceItem(item);
|
wsItem = HLMapper.toWorkspaceItem(item);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
LOGGER.error("Error during uploading the file: "+fileName+" in the folderId: "+folderId, e);
|
LOGGER.error("Error uploading the file: "+fileName+" in the folderId: "+folderId, e);
|
||||||
String error = e.getMessage()!=null?e.getMessage():"";
|
throw e;
|
||||||
throw new InternalErrorException("Error during uploading the file: "+fileName+". "+error);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return wsItem;
|
return wsItem;
|
||||||
|
|
|
@ -149,14 +149,10 @@ public interface Workspace{
|
||||||
* @param inputStream the input stream
|
* @param inputStream the input stream
|
||||||
* @param fileName the file name
|
* @param fileName the file name
|
||||||
* @param fileDescription the file description
|
* @param fileDescription the file description
|
||||||
* @return the item
|
* @return the workspace item
|
||||||
* @throws InsufficientPrivilegesException the insufficient privileges exception
|
* @throws Exception the 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
|
|
||||||
*/
|
*/
|
||||||
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.
|
* Gets the shared folder members.
|
||||||
|
@ -288,7 +284,7 @@ public interface Workspace{
|
||||||
public URL getPublicLinkForFile(String fileItemId) throws Exception;
|
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 fileItemId the file item id
|
||||||
* @param version the version
|
* @param version the version
|
||||||
|
|
Loading…
Reference in New Issue