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;