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 2526266..8391ee8 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java @@ -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"); 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 d1220a4..707d120 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java @@ -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"; 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 c040766..8284f1d 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 @@ -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; + + + + + +