Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / io / IdentifyFile.java
index b8a4d6a..3024039 100755 (executable)
@@ -20,6 +20,7 @@
  */
 package jalview.io;
 
+import java.util.Locale;
 import java.io.File;
 import java.io.IOException;
 
@@ -178,7 +179,7 @@ public class IdentifyFile
             break;
           }
         }
-        data = data.toUpperCase();
+        data = data.toUpperCase(Locale.ROOT);
 
         if (data.startsWith(ScoreMatrixFile.SCOREMATRIX))
         {
@@ -190,6 +191,19 @@ public class IdentifyFile
           reply = FileFormat.HMMER3;
           break;
         }
+        if (data.startsWith("LOCUS"))
+        {
+          reply = FileFormat.GenBank;
+          break;
+        }
+        if (data.startsWith("ID "))
+        {
+          if (data.substring(2).trim().split(";").length == 7)
+          {
+            reply = FileFormat.Embl;
+            break;
+          }
+        }
         if (data.startsWith("H ") && !aaIndexHeaderRead)
         {
           aaIndexHeaderRead = true;
@@ -324,7 +338,7 @@ public class IdentifyFile
         if ((lessThan > -1)) // possible Markup Language data i.e HTML,
                              // RNAML, XML
         {
-          String upper = data.toUpperCase();
+          String upper = data.toUpperCase(Locale.ROOT);
           if (upper.substring(lessThan).startsWith("<HTML"))
           {
             reply = FileFormat.Html;