42 lines
1.8 KiB
Java
42 lines
1.8 KiB
Java
package org.gcube.usecases.ws.thredds;
|
|
|
|
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
|
import org.gcube.usecases.ws.thredds.engine.impl.WorkspaceUtils;
|
|
import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
|
|
|
|
public class DTTests {
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
// TestCommons.setScope();
|
|
// String threddsHostname="thredds-d-d4s.d4science.org";
|
|
// DataTransferClient client=DataTransferClient.getInstanceByEndpoint("http://"+threddsHostname+":80");
|
|
// Destination toSetDestination=new Destination();
|
|
// toSetDestination.setCreateSubfolders(true);
|
|
// toSetDestination.setDestinationFileName("transferTest.tst");
|
|
// toSetDestination.setOnExistingFileName(DestinationClashPolicy.REWRITE);
|
|
// toSetDestination.setOnExistingSubFolder(DestinationClashPolicy.APPEND);
|
|
// toSetDestination.setPersistenceId("thredds");
|
|
//
|
|
// //NB ITEM IS SUPPOSED TO HAVE REMOTE PATH
|
|
// String fileLocation="WS-Tests/mySub";
|
|
// toSetDestination.setSubFolder(fileLocation);
|
|
//
|
|
// File temp=File.createTempFile("testTransfer", "tmp");
|
|
// IOUtils.copy(new URL("http://data-d.d4science.org/SUlDWjIxamdaUTdHcmpvdEFmcFFPOUcvbjF5VyswbXlHbWJQNStIS0N6Yz0").openStream(), new FileOutputStream(temp));
|
|
//
|
|
// System.out.println(client.localFile(temp,
|
|
// toSetDestination,Collections.singleton(new PluginInvocation(Constants.SIS_PLUGIN_ID))));
|
|
//
|
|
|
|
TokenSetter.set("/gcube/devNext");
|
|
// Workspace ws = HomeLibrary.getHomeManagerFactory().getHomeManager().getHome().getWorkspace();
|
|
StorageHubClient client=WorkspaceUtils.getClient();
|
|
|
|
String folderId=TestCommons.getByPath("/Workspace/Accounting").getId();
|
|
SyncEngine.get().setSynchronizedFolder(new SynchFolderConfiguration("another", "", TokenSetter.getCurrentToken(), "dummy",folderId), folderId);
|
|
System.out.println("Done");
|
|
|
|
}
|
|
|
|
}
|