gcube-cms-suite/geoportal-client/src/test/java/org/gcube/application/geoportal/StorageTests.java

39 lines
1.1 KiB
Java
Raw Normal View History

2021-09-20 16:47:35 +02:00
package org.gcube.application.geoportal;
2021-09-21 17:45:18 +02:00
import org.gcube.application.cms.tests.TokenSetter;
2021-09-20 16:47:35 +02:00
import org.gcube.application.geoportal.common.utils.StorageUtils;
2021-09-21 17:45:18 +02:00
import java.io.IOException;
2021-09-20 16:47:35 +02:00
public class StorageTests {
2021-09-21 17:45:18 +02:00
public static void main(String[] args) throws IOException {
2021-09-27 15:23:03 +02:00
// String filename= "relazione.pdf";
2021-09-20 16:47:35 +02:00
2021-09-21 17:45:18 +02:00
// String sourceContext="/d4science.research-infrastructures.eu";
// String targetContext="/pred4s/preprod/preVRE";
String targetContext="/gcube/devsec/devVRE";
2021-09-20 16:47:35 +02:00
2021-09-21 17:45:18 +02:00
// TokenSetter.set(sourceContext);
// StorageHubClient sgClient=new StorageHubClient();
// System.out.println(new StorageUtils().getUrlById(file.getId()));
2021-09-20 16:47:35 +02:00
TokenSetter.set(targetContext);
2021-09-27 15:23:03 +02:00
System.out.println(new StorageUtils().getURL("e6b5d48d-b37d-4280-900d-f407a1ddc7d3"));
2021-09-20 16:47:35 +02:00
2021-09-21 17:45:18 +02:00
2021-09-27 15:23:03 +02:00
// System.out.println(new File(".").getAbsolutePath());
// TempFile file= new StorageUtils().putOntoStorage(new File(TestModel.getBaseFolder(),filename),filename);
//
// IOUtils.copy(new URL(StorageUtils.getUrlById(file.getId())).openStream(),System.out);
2021-09-20 16:47:35 +02:00
}
2021-09-27 15:23:03 +02:00
2021-09-20 16:47:35 +02:00
}