From: Sasha Sherstnev Date: Mon, 28 Oct 2013 20:22:05 +0000 (+0000) Subject: Remove surplus code and add format of the source file X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2260ca3b3c0382ef6bfeea7341a692508058a2a6;p=proteocache.git Remove surplus code and add format of the source file --- diff --git a/datadb/compbio/cassandra/JpredParserHTTP.java b/datadb/compbio/cassandra/JpredParserHTTP.java index 3616818..e308a25 100644 --- a/datadb/compbio/cassandra/JpredParserHTTP.java +++ b/datadb/compbio/cassandra/JpredParserHTTP.java @@ -19,17 +19,17 @@ import compbio.cassandra.JpredParser; 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) { @@ -64,10 +64,14 @@ public class JpredParserHTTP implements JpredParser { 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) {