Remove surplus code and add format of the source file
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 28 Oct 2013 20:22:05 +0000 (20:22 +0000)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Mon, 28 Oct 2013 20:22:05 +0000 (20:22 +0000)
datadb/compbio/cassandra/JpredParserHTTP.java

index 3616818..e308a25 100644 (file)
@@ -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) {