JAL-1641 JSONFile format support for jalview alignment
[jalview.git] / src / jalview / io / IdentifyFile.java
index aa9c354..3b4fd1a 100755 (executable)
@@ -136,13 +136,19 @@ public class IdentifyFile
 
           break;
         }
-        if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        if (data.indexOf("{\"SEQS\":[{\"FEATURES") > -1)
         {
-          reply = HtmlFile.FILE_DESC;
+          reply = JSONFile.FILE_DESC;
+          break;
+        }
+        // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        {
+          reply = "HTML";
           break;
         }
 
-        if ((data.indexOf("<") > -1))
+        if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>"))
         {
           reply = "RNAML";