From: gmungoc Date: Mon, 9 May 2016 14:18:12 +0000 (+0100) Subject: JAL-2098 identify feature file with "<" in feature type name X-Git-Tag: Release_2_10_0~227^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bab92f1e137903283c0b0fb986d01b6f91cdd82e;p=jalview.git JAL-2098 identify feature file with "<" in feature type name --- diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 71f4237..889359f 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -230,7 +230,6 @@ public class IdentifyFile } catch (IOException ex) { } - ; if (dta != null && dta.indexOf("*") > -1) { starterm = true; @@ -250,34 +249,19 @@ public class IdentifyFile // read as a FASTA (probably) break; } - if ((data.indexOf("<") > -1)) // possible Markup Language data i.e HTML, + int lessThan = data.indexOf("<"); + if ((lessThan > -1)) // possible Markup Language data i.e HTML, // RNAML, XML { - // FIXME this is nuts - it consumes the rest of the file if no match - boolean identified = false; - do - { - if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>")) - { - reply = HtmlFile.FILE_DESC; - identified = true; - break; - } - - if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>")) - { - reply = "RNAML"; - identified = true; - break; - } - } while ((data = source.nextLine()) != null); - - if (identified) + String upper = data.toUpperCase(); + if (upper.substring(lessThan).startsWith("