package org.gcube.application.geoportal; import org.gcube.application.cms.tests.TokenSetter; import org.gcube.application.geoportal.common.utils.StorageUtils; import java.io.IOException; public class StorageTests { public static void main(String[] args) throws IOException { // String filename= "relazione.pdf"; // String sourceContext="/d4science.research-infrastructures.eu"; // String targetContext="/pred4s/preprod/preVRE"; String targetContext="/gcube/devsec/devVRE"; // TokenSetter.set(sourceContext); // StorageHubClient sgClient=new StorageHubClient(); // System.out.println(new StorageUtils().getUrlById(file.getId())); TokenSetter.set(targetContext); System.out.println(new StorageUtils().getURL("e6b5d48d-b37d-4280-900d-f407a1ddc7d3")); // 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); } }