This commit is contained in:
Fabio Sinibaldi 2020-12-01 15:58:49 +01:00
parent 957b69144d
commit 5685698a02
3 changed files with 11 additions and 5 deletions

View File

@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for org.gcube.data.transfer.data-transfer-library
##[v1.2.3-SNAPSHOT] 2020-12-01
##[v1.2.3] 2020-12-01
* Deletion method
* GetInfo method

View File

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.data.transfer</groupId>
<artifactId>data-transfer-library</artifactId>
<version>1.2.3-SNAPSHOT</version>
<version>1.2.3</version>
<name>DataTransfer-library</name>
<description>Data Transfer Service client library</description>

View File

@ -34,7 +34,7 @@ public class TestClientCalls {
static String hostname="https://geoserver1.dev.d4science.org";
static String scope="/gcube/devsec/devVRE";
static Client client;
static long testRun=System.currentTimeMillis();
@BeforeClass
public static void init() throws ServiceNotFoundException{
@ -63,7 +63,7 @@ public class TestClientCalls {
private RemoteFileDescriptor transfer() throws RemoteServiceException, MalformedURLException {
Destination dest=new Destination("readme.md");
dest.setCreateSubfolders(true);
dest.setSubFolder("bla/bla/bllaaa");
dest.setSubFolder("test/testSub/"+testRun);
dest.setOnExistingFileName(DestinationClashPolicy.ADD_SUFFIX);
dest.setOnExistingSubFolder(DestinationClashPolicy.APPEND);
TransferRequest request= new TransferRequest("", new HttpDownloadSettings(new URL("https://code-repo.d4science.org/gCubeSystem/data-transfer-library/raw/branch/master/README.md"), HttpDownloadOptions.DEFAULT),dest);
@ -106,8 +106,14 @@ public class TestClientCalls {
public void delete() throws RemoteServiceException, MalformedURLException {
RemoteFileDescriptor remote=transfer();
client.delete(remote);
}
@Test
public void deleteFolder() throws RemoteServiceException, MalformedURLException {
RemoteFileDescriptor remote=transfer();
// try to delete parent
client.delete(remote.getPersistenceId()+"/"+remote.getPath());
client.delete(remote.getPersistenceId()+"/"+remote.getPath().substring(0,remote.getPath().lastIndexOf("/")));
}
@Test