JAL-1953 2.11.2 with Archeopteryx!
[jalview.git] / src / jalview / io / IdentifyFile.java
index c21127e..d2c586a 100755 (executable)
@@ -386,15 +386,33 @@ public class IdentifyFile
           reply = FileFormat.Phylip;
           break;
         }
-        else
+        else if (!lineswereskipped && looksLikeJnetData(data))
         {
-          if (!lineswereskipped && looksLikeJnetData(data))
-          {
             reply = FileFormat.Jnet;
             break;
-          }
+
         }
+        else // phylogenetic file
+        {
+          String identifier = data.toLowerCase();
+          String secondLine = source.nextLine().toLowerCase();
+          if (identifier.startsWith("<phyloxml")
+                  || secondLine.startsWith("<phyloxml"))
+          {
+            reply = FileFormat.PhyloXML;
+            break;
+          }
+          // commented out, nexus parser is troublesome
 
+          // else if (((identifier.startsWith("nexus"))
+          // || (identifier.startsWith("#nexus"))
+          // || (identifier.startsWith("# nexus"))
+          // || (identifier.startsWith("begin"))))
+          // {
+          // reply = FileFormat.Nexus;
+          // break;
+          // }
+        }
         lineswereskipped = true; // this means there was some junk before any
         // key file signature
       }