X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FIdentifyFile.java;h=14848c77dd9d927bdaf0bc0195c51eaeb08ba5bd;hb=refs%2Fheads%2Fj2s%2Fdevelop-bh-2;hp=4c83ac155e8948a8e8d36a2d03e160bf9fe270da;hpb=c07eb2c5794833bd0241000d6844d783fe10cb82;p=jalview.git diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 4c83ac1..14848c7 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -20,6 +20,9 @@ */ package jalview.io; +import jalview.jsdev.Constants; +import jalview.jsdev.GenericFileAdapter; + import java.io.IOException; /** @@ -143,13 +146,13 @@ public class IdentifyFile break; } // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>")) - if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>")) + if (data.matches("])*>")) // BH was (?i)rnaml, but JavaScript regex does not support (?i); data is already upper case { - reply = HtmlFile.FILE_DESC; + reply = Constants.Html_FILE_DESC; break; } - if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>")) + if (data.matches("])*>")) // BH was (?i)rnaml, but JavaScript regex does not support (?i); data is already upper case { reply = "RNAML"; break; @@ -157,7 +160,7 @@ public class IdentifyFile if (data.indexOf("{\"") > -1) { - reply = JSONFile.FILE_DESC; + reply = Constants.JSON_FILE_DESC; break; } if ((data.length() < 1) || (data.indexOf("#") == 0)) @@ -287,7 +290,7 @@ public class IdentifyFile } else if (data.matches("\\s*\\d+\\s+\\d+\\s*")) { - reply = PhylipFile.FILE_DESC; + reply = Constants.Phylip_FILE_DESC; break; } @@ -335,6 +338,11 @@ public class IdentifyFile return reply; } + /** + * @j2sIgnore + * + * @param args + */ public static void main(String[] args) {