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 b09f534..077520a 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java @@ -678,6 +678,24 @@ public class StorageHubClientService { } + /** + * Gets the public link for file version. + * + * @param fileItemId the file item id + * @return the public link for file version + * @throws Exception the exception + */ + public URL getPublicLinkForFileVersion(String fileItemId, String version) throws Exception{ + + Validate.notNull(fileItemId, "Bad request of getPublicLinkForFile, the fileItemId is null"); + Validate.notNull(version, "Bad request of getPublicLinkForFileVersion, the version is null"); + Validate.notEmpty(version, "Bad request of getPublicLinkForFileVersion, the version is empty"); + setContextProviders(scope, authorizationToken); + return shcClient.open(fileItemId).asFile().getPublicLink(version); + + } + + /** * Gets the list versions. *