diff --git a/changelog.md b/changelog.md
new file mode 100644
index 0000000..ec8a6d4
--- /dev/null
+++ b/changelog.md
@@ -0,0 +1,88 @@
+# Changelog for storagehub-client-wrapper
+
+All notable changes to this project will be documented in this file.
+This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [v0-7-1] [r4-23-0] - [2020-05-18]
+
+** Enhancements **
+
+[#19058] added the folder destination Id to restore operation
+
+
+## [v0-7-0] [r4-22-0] - [2020-04-16]
+
+** Enhancements **
+
+[Task #19087] provide a getItem (without getRoot inside) for Workspace-Explorer-App
+
+
+
+## [v0-6-2] [r4-21-0] - [2020-03-11]
+
+** New features **
+
+[#18174] Moved to new search facility provided by SHUB
+
+
+
+## [0-6-1] - [2019-12-19]
+
+Ported to Git and Jenkins
+
+
+
+## [0-6-0] - [2019-10-01]
+
+[Task #16688] Integrating new method added into SHUB
+
+
+
+## [0-5-0] - [2019-08-01]
+
+Released due to exceptions thrown by SHUB
+
+
+
+## [0-4-0] - [2019-06-01]
+
+Updated to new SHub interface
+
+Added method getMetadata
+
+
+
+## [0-3-0] - [2018-03-01]
+
+[Task #12059] added delete item
+
+[Task #12533] added trash operations
+
+[Task #12556] added download facility
+
+[Task #12601] added download folder facility
+
+[Task #12604] added Move operation to StorageHub
+
+[Task #12603] added Copy operation to StorageHub
+
+[Task #12603] added Rename facility to StorageHub
+
+[Task #12603] added Public Link facility to StorageHub
+
+[Task #12664] added Versions facility to StorageHub
+
+[Task #12720] added Image Preview to StorageHub
+
+
+
+## [0-2-0] - [2018-06-20]
+
+minor fixes
+
+
+
+## [0-1-0] - [2018-06-20]
+
+[Task #12059] first release
+
diff --git a/changelog.xml b/changelog.xml
deleted file mode 100644
index 636200c..0000000
--- a/changelog.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
- [Task #19087] provide a getItem (without getRoot inside) for Workspace-Explorer-App
-
-
-
- [Feature #18174] Moved to new search facility provided by SHUB
-
-
-
- Updated to Git and Jenkins
-
-
- [Task #16688] Integrating new method added into SHUB
-
-
- Released due to exceptions thrown by SHUB
-
-
- Updated to new SHub interface
- Added method getMetadata
-
-
- [Task #12059] added delete item
- [Task #12533] added trash operations
- [Task #12556] added download facility
- [Task #12601] added download folder facility
- [Task #12604] added Move operation to StorageHub
- [Task #12603] added Copy operation to StorageHub
- [Task #12603] added Rename facility to StorageHub
- [Task #12603] added Public Link facility to StorageHub
-
- [Task #12664] added Versions facility to StorageHub
-
- [Task #12720] added Image Preview to StorageHub
-
-
-
- minor fixes
-
-
- [Task #12059] first release
-
-
diff --git a/descriptor.xml b/descriptor.xml
index 16e0787..93dd4a7 100644
--- a/descriptor.xml
+++ b/descriptor.xml
@@ -14,7 +14,7 @@
README.md
LICENSE.md
- changelog.xml
+ changelog.md
profile.xml
755
diff --git a/pom.xml b/pom.xml
index fc95fc4..58715d5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
org.gcube.common
storagehub-client-wrapper
- 0.7.0
+ 0.7.1-SNAPSHOT
storagehub-client-wrapper
This is a wrapper of storagehub-client library. It allows to interact with storagehub in a simplified way by exposing several utilities. Moreover, It exposes by another inteface java beans as defined in (the old) HL interfaces
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 ac7b0d2..846b08a 100644
--- a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java
+++ b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java
@@ -638,21 +638,27 @@ public class StorageHubClientService {
shcClient.emptyTrash();
}
-
-
+
+
/**
* Restore thrash item.
*
* @param itemId the item id
+ * @param destinationFolderId the destination folder id
* @return the item
* @throws Exception the exception
*/
- public Item restoreThrashItem(String itemId) throws Exception{
+ public Item restoreThrashItem(String itemId, String destinationFolderId) throws Exception{
Validate.notNull(itemId, "Bad request to restoreThrashItem, the itemId is null");
setContextProviders(scope, authorizationToken);
- GenericItemContainer container = shcClient.restoreThrashItem(itemId);
-
+
+ GenericItemContainer container = null;
+ if(destinationFolderId==null)
+ container = shcClient.restoreThrashItem(itemId);
+ else
+ container = shcClient.restoreThrashItem(itemId, destinationFolderId);
+
if(container!=null){
Item item = container.get();
if(item!=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 d6bf2c3..b80b027 100644
--- a/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java
+++ b/src/main/java/org/gcube/common/storagehubwrapper/server/WorkspaceStorageHubClientService.java
@@ -934,21 +934,20 @@ public final class WorkspaceStorageHubClientService implements Workspace{
}
+
/**
* Restore thrash item.
*
* @param itemId the item id
+ * @param destinationFolderId the destination folder id
* @return the workspace item
* @throws Exception the exception
*/
- /* (non-Javadoc)
- * @see org.gcube.common.storagehubwrapper.server.tohl.Workspace#restoreThrashItem(java.lang.String)
- */
@Override
- public WorkspaceItem restoreThrashItem(String itemId) throws Exception{
+ public WorkspaceItem restoreThrashItem(String itemId, String destinationFolderId) throws Exception{
try{
- Item theItem = storageHubClientService.restoreThrashItem(itemId);
+ Item theItem = storageHubClientService.restoreThrashItem(itemId,destinationFolderId);
return HLMapper.toWorkspaceItem(theItem);
}catch(Exception e){
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 b739b85..aab6bd6 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
@@ -236,18 +236,17 @@ public interface Workspace{
public void emptyTrash() throws Exception;
-
/**
* Restore thrash item.
*
* @param itemId the item id
- * @return the item
+ * @param destinationFolderId the destination folder id
+ * @return the workspace item
* @throws Exception the exception
*/
- public WorkspaceItem restoreThrashItem(String itemId) throws Exception;
-
-
+ public WorkspaceItem restoreThrashItem(String itemId, String destinationFolderId) throws Exception;
+
/**
* Gets the filtered children.
*
@@ -515,7 +514,7 @@ public interface Workspace{
throws InternalErrorException, ItemNotFoundException, WrongItemTypeException;
/**
- * Gets the item for Explorer
+ * Gets the item for Explorer.
*
* @param itemId the item id
* @param withAccounting the with accounting