added method getPublicLinkForFile(String fileItemId, String version)

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@176369 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2019-01-08 14:27:41 +00:00
parent 73e1003326
commit 62a595d7d1
1 changed files with 21 additions and 0 deletions

View File

@ -841,6 +841,27 @@ public final class WorkspaceStorageHubClientService implements Workspace{
}
}
/**
* Gets the public link for file.
*
* @param fileItemId the file item id
* @param version the version
* @return the public link for file
* @throws Exception the exception
*/
public URL getPublicLinkForFile(String fileItemId, String version) throws Exception{
try{
return storageHubClientService.getPublicLinkForFileVersion(fileItemId, version);
}catch(Exception e){
logger.error("Error on getting public link for file: "+fileItemId +" with version: "+version, e);
String error = e.getMessage()!=null?e.getMessage():"Operation not allowed";
throw new Exception("Error on getting public link for file: "+fileItemId +" with version: "+version+". Error: "+error);
}
}
/**
* Gets the list versions for file.
*