Added method getPublicLinkForFile(String fileItemId)

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@173265 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-10-12 08:30:38 +00:00
parent e63afe0688
commit 0b6e876cc3
3 changed files with 20 additions and 5 deletions

View File

@ -570,7 +570,7 @@ public class StorageHubClientService {
* @return the file public link
* @throws Exception the exception
*/
public URL getFilePublicLink(String fileItemId) throws Exception{
public URL getPublicLinkForFile(String fileItemId) throws Exception{
Validate.notNull(fileItemId, "Bad invoking get public link, the itemId is null");

View File

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

View File

@ -5,6 +5,7 @@ package org.gcube.common.storagehubwrapper.server.tohl;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import java.util.Map;
@ -272,6 +273,20 @@ public interface Workspace{
/**
* Gets the public link for file.
*
* @param fileItemId the file item id
* @return the public link for file
* @throws Exception the exception
*/
public URL getPublicLinkForFile(String fileItemId) throws Exception;