fix for no access-control-origin on jalview site
[jalview.git] / src / jalview / io / FileParse.java
index 7117d0f..1ee1db6 100755 (executable)
@@ -39,6 +39,8 @@ import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.zip.GZIPInputStream;
 
+import javajs.util.Rdr;
+
 /**
  * implements a random access wrapper around a particular datasource, for
  * passing to identifyFile and AlignFile objects.
@@ -339,6 +341,23 @@ public class FileParse
         }
       }
     }
+    else if (sourceType == DataSourceType.LOCALURL)
+    {
+      String data = null;
+      /**
+       * BH 2018 hack for no support for access-origin
+       * 
+       * @j2sNative
+       * 
+       *            data = $.ajax({url:fileStr, async:false}).responseText;
+       * 
+       */
+
+      System.out.println(data);
+      dataIn = Rdr.getBR(data);
+      dataName = fileStr;
+
+    }
     else if (sourceType == DataSourceType.URL)
     {
       try