diff --git a/src/test/java/UriResolverTest.java b/src/test/java/UriResolverTest.java index 241bd2d..760664d 100644 --- a/src/test/java/UriResolverTest.java +++ b/src/test/java/UriResolverTest.java @@ -15,28 +15,30 @@ import java.net.URLConnection; * */ public class UriResolverTest { + + public static String hostname = "http://dev.d4science.org/uri-resolver/smp?"; // CASE IS NULL -// public static final String uri = "http://localhost:8080/uri-resolver/smp?fileName=HCAF_2050&contentType=text%2Fcsv&smp-uri=smp%3A%2F%2FShare%2Fcd8cb73f-feb6-4072-864c-3bb57f81ad56%2FHCAF+2050%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; +// public static final String uri = hostname+"fileName=HCAF_2050&contentType=text%2Fcsv&smp-uri=smp%3A%2F%2FShare%2Fcd8cb73f-feb6-4072-864c-3bb57f81ad56%2FHCAF+2050%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; // public static String filename = "HCAF_2050"; // public static String ext = "csv"; // CASE OK -// public static final String uri = "http://localhost:8080/uri-resolver/smp?fileName=gattino02.jpg&contentType=audio%2Fmpeg&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2Fgattino02.jpg%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; +// public static final String uri = hostname+"fileName=gattino02.jpg&contentType=audio%2Fmpeg&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2Fgattino02.jpg%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; // public static String filename ="gattino02"; // public static String ext = "jpg"; // ANOTHER CASE OK -// public static final String uri = "http://localhost:8080/uri-resolver/smp?fileName=org.gcube.portlets-user.messages-0.4.0-0.notifica&contentType=application%2Fx-gtar&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2FSharedFolder1%2Forg.gcube.portlets-user.messages-0.4.0-0.notifica%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; +// public static final String uri = hostname+"fileName=org.gcube.portlets-user.messages-0.4.0-0.notifica&contentType=application%2Fx-gtar&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2FSharedFolder1%2Forg.gcube.portlets-user.messages-0.4.0-0.notifica%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; // public static String filename ="org.gcube.portlets-user.messages-0.4.0-0.notifica"; // public static String ext = "war"; //SIZE 0 - public static final String uri = "http://localhost:8080/uri-resolver/smp?fileName=Untitled_Document&contentType=application%2Foctet-stream&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2FUntitled+Document%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; + public static final String uri = hostname+"fileName=Untitled_Document&contentType=application%2Foctet-stream&smp-uri=smp%3A%2F%2FHome%2Ffrancesco.mangiacrapa%2FWorkspace%2FUntitled+Document%3F5ezvFfBOLqb3YESyI%2FkesN4T%2BZD0mtmc%2F4sZ0vGMrl0lgx7k85j8o2Q1vF0ezJi%2FTEYl7d%2BF4sKR7EwqeONAlQygGb2MgXevVwnFtqGknsyTZoV3fuG3iZ3%2BAsJaJDUH7F%2FELBV1lV8smBnSfc4vhDULwoWY6CWZ2tGj15BzeBI%3D"; public static String filename ="Untitled_Document"; - public static String ext = "pplication%2Foctet-stream"; + public static String ext = "txt"; public static void main(String[] args) { @@ -65,7 +67,7 @@ public class UriResolverTest { System.out.println("URL is valid, continue.."); - /* + // DOWNLOAD URL URLConnection connection = new URL(url).openConnection(); // InputStream response = connection.getInputStream(); @@ -90,7 +92,7 @@ public class UriResolverTest { outputStream.flush(); System.out.println("DOWNLOAD COMPLETED!"); -*/ + } catch (IOException e) { e.printStackTrace();