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;