X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FIdentifyFile.java;h=deae9ae7ece309e8f40515ff38306621b1acb42e;hb=d7361eaa08dc9af7d996851f39b7a2007d1b8832;hp=71f423769bb0d3031d7f126162c953f598f024f8;hpb=4da7d6ec8ef5ff030c6d06d37a099da2d92d7246;p=jalview.git diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 71f4237..deae9ae 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, - // RNAML, XML + 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("