public class JpredParserHTTP implements JpredParser {
private CassandraCreate cc = new CassandraCreate();
private String dirprefix;
-
+
JpredParserHTTP() {
- this.dirprefix = "http://www.compbio.dundee.ac.uk/www-jpred/results";
+ dirprefix = "http://www.compbio.dundee.ac.uk/www-jpred/results";
}
-
+
JpredParserHTTP(String sourceurl) {
- this.dirprefix = sourceurl;
+ dirprefix = sourceurl;
}
- public void setSource (String newsourceprefix) {
- this.dirprefix = newsourceprefix;
+ public void setSource(String newsourceprefix) {
+ dirprefix = newsourceprefix;
}
public void Parsing(String source, int nDays) {
while ((line = alljobs.readLine()) != null) {
if (line.matches(date + "(.*)jp_[^\\s]+")) {
String[] table = line.split("\\s+");
+ // Format of a record:
+ // starttime endtime ip email jobid (directory)
+ // 013/10/25:21:55:7 2013/10/25:21:59:13 201.239.98.172 unknown_email jp_J9HBCBT
String id = table[table.length - 1];
totalcount++;
if (!cc.CheckID(id)) {
- URL urltable = new URL(dirprefix + "/" + id + "/" + id + ".concise.fasta");
+ String datalink = dirprefix + "/" + id + "/" + id + ".concise.fasta";
+ URL urltable = new URL(datalink);
HttpURLConnection httpConnection = (HttpURLConnection) urltable.openConnection();
int responsecode = httpConnection.getResponseCode();
if (199 < responsecode && responsecode < 300) {