JSON refactoring of a few methods; fixing JavaScript issues
[jalview.git] / src / jalview / javascript / web / WebResource.java
index c55e9ba..1896b65 100644 (file)
@@ -2,8 +2,10 @@ package jalview.javascript.web;
 
 import jalview.util.Platform;
 
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URL;
 
 /*
  *  A JavaScript-only proxy for com.sun.jersey.api.client.WebResource
@@ -64,8 +66,13 @@ public class WebResource
      */
     public ClientResponse get(Class<?> c)
     {
-      return new ClientResponse(Platform.getFileAsString(uri.toString()),
-              encoding);
+      try
+      {
+        return new ClientResponse(new URL(uri.toString()), encoding);
+      } catch (MalformedURLException e)
+      {
+        return null;
+      }
     }
   }