git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e9c7525
)
JAL-1806 bug fix to loop through the entire data file to check for a html or rnaml...
author
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 9 Jul 2015 12:57:12 +0000
(13:57 +0100)
committer
tcofoegbu
<tcnofoegbu@dundee.ac.uk>
Thu, 9 Jul 2015 12:57:12 +0000
(13:57 +0100)
src/jalview/io/IdentifyFile.java
patch
|
blob
|
history
diff --git
a/src/jalview/io/IdentifyFile.java
b/src/jalview/io/IdentifyFile.java
index
4c83ac1
..
dae8f82
100755
(executable)
--- a/
src/jalview/io/IdentifyFile.java
+++ b/
src/jalview/io/IdentifyFile.java
@@
-142,19
+142,35
@@
public class IdentifyFile
reply = "STH";
break;
}
reply = "STH";
break;
}
- // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
- if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
- {
- reply = HtmlFile.FILE_DESC;
- break;
- }
- if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+ if ((data.indexOf("<") > -1)) // possible Markup Language data i.e HTML,
+ // RNAML, XML
{
{
- reply = "RNAML";
- break;
+ 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)
+ {
+ break;
+ }
}
}
+
if (data.indexOf("{\"") > -1)
{
reply = JSONFile.FILE_DESC;
if (data.indexOf("{\"") > -1)
{
reply = JSONFile.FILE_DESC;