JAL-2805 file identifying lines are turned to lowercase before matching
authorkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 9 Jan 2018 23:08:29 +0000 (23:08 +0000)
committerkjvdheide <kjvanderheide@dundee.ac.uk>
Tue, 9 Jan 2018 23:08:29 +0000 (23:08 +0000)
src/jalview/io/IdentifyFile.java

index 854a46e..a7ed592 100755 (executable)
@@ -340,16 +340,20 @@ public class IdentifyFile
             break;
 
         }
-        else // phylogenetic file?
+        else // phylogenetic file
         {
-          if (data.startsWith("<phyloxml")
-                  || source.nextLine().startsWith("<phyloxml"))
+          String identifier = data.toLowerCase();
+          String secondLine = source.nextLine().toLowerCase();
+          if (identifier.startsWith("<phyloxml")
+                  || secondLine.startsWith("<phyloxml"))
           {
             reply = FileFormat.PhyloXML;
             break;
           }
-          else if (( ( data.startsWith( "nexus" ) ) || ( data.startsWith( "#nexus" ) )
-                || ( data.startsWith( "# nexus" ) ) || ( data.startsWith( "begin" ) ) ) ) 
+          else if (((identifier.startsWith("nexus"))
+                  || (identifier.startsWith("#nexus"))
+                  || (identifier.startsWith("# nexus"))
+                  || (identifier.startsWith("begin"))))
           {
           reply = FileFormat.Nexus;      
            break;