JAL-1807
[jalview.git] / src / jalview / io / IdentifyFile.java
index 4c83ac1..14848c7 100755 (executable)
@@ -20,6 +20,9 @@
  */
 package jalview.io;
 
+import jalview.jsdev.Constants;
+import jalview.jsdev.GenericFileAdapter;
+
 import java.io.IOException;
 
 /**
@@ -143,13 +146,13 @@ public class IdentifyFile
           break;
         }
         // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
-        if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        if (data.matches("<HTML(\"[^\"]*\"|'[^']*'|[^'\">])*>")) // BH was (?i)rnaml, but JavaScript regex does not support (?i); data is already upper case
         {
-          reply = HtmlFile.FILE_DESC;
+          reply = Constants.Html_FILE_DESC;
           break;
         }
 
-        if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        if (data.matches("<RNAML (\"[^\"]*\"|'[^']*'|[^'\">])*>")) // BH was (?i)rnaml, but JavaScript regex does not support (?i); data is already upper case
         {
           reply = "RNAML";
           break;
@@ -157,7 +160,7 @@ public class IdentifyFile
 
          if (data.indexOf("{\"") > -1)
          {
-         reply = JSONFile.FILE_DESC;
+         reply = Constants.JSON_FILE_DESC;
          break;
          }
         if ((data.length() < 1) || (data.indexOf("#") == 0))
@@ -287,7 +290,7 @@ public class IdentifyFile
         }
         else if (data.matches("\\s*\\d+\\s+\\d+\\s*"))
         {
-          reply = PhylipFile.FILE_DESC;
+          reply = Constants.Phylip_FILE_DESC;
           break;
         }
 
@@ -335,6 +338,11 @@ public class IdentifyFile
     return reply;
   }
 
+  /**
+   * @j2sIgnore
+   * 
+   * @param args
+   */
   public static void main(String[] args)
   {