JAL-2543 identify as JSON before HTML
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 22 May 2017 13:13:23 +0000 (14:13 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 22 May 2017 13:13:23 +0000 (14:13 +0100)
src/jalview/io/IdentifyFile.java

index 035c1fa..be0df21 100755 (executable)
@@ -274,6 +274,11 @@ public class IdentifyFile
           // read as a FASTA (probably)
           break;
         }
+        if (data.indexOf("{\"") > -1)
+        {
+          reply = FileFormat.Json;
+          break;
+        }
         int lessThan = data.indexOf("<");
         if ((lessThan > -1)) // possible Markup Language data i.e HTML,
                              // RNAML, XML
@@ -291,11 +296,6 @@ public class IdentifyFile
           }
         }
 
-        if (data.indexOf("{\"") > -1)
-        {
-          reply = FileFormat.Json;
-          break;
-        }
         if ((data.length() < 1) || (data.indexOf("#") == 0))
         {
           lineswereskipped = true;