public String Identify(FileParse source, boolean closeSource) {
String reply = "PFAM";
String data;
+ boolean lineswereskipped=false;
try {
while ( (data = source.nextLine()) != null)
{
break;
}
- if ( (data.indexOf("#") == 0) || (data.length() < 1))
+ if ((data.length() < 1) || (data.indexOf("#") == 0))
{
+ lineswereskipped=true;
continue;
}
reply = "PDB";
break;
}
- else if (data.indexOf(":") < data.indexOf(",")) // && data.indexOf(",")<data.indexOf(",", data.indexOf(",")))
+ else if (!lineswereskipped
+ && data.charAt(0)!='*'
+ && data.charAt(0)!=' '
+ && data.indexOf(":") < data.indexOf(",")) // && data.indexOf(",")<data.indexOf(",", data.indexOf(",")))
{
// file looks like a concise JNet file
reply = "JnetFile";
reply="Jalview"; // archive.
break;
}
+
+ lineswereskipped=true; // this means there was some junk before any key file signature
}
if (closeSource) {
source.close();