X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Febi%2FEBIFetchClient.java;h=a785899ec15c7605a64f2d0e6b676d21c9958d83;hb=a394f0df3650d5b1e0b76e0319b650fe8ac98e41;hp=623a586159359d821951ead58c186def55da383c;hpb=865a855a4ca87eadb3e5ff284ed32ed307d9c34b;p=jalview.git
diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java
index 623a586..a785899 100644
--- a/src/jalview/ws/ebi/EBIFetchClient.java
+++ b/src/jalview/ws/ebi/EBIFetchClient.java
@@ -1,19 +1,21 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
*
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.ws.ebi;
@@ -22,11 +24,15 @@ import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
+import java.util.List;
import java.util.StringTokenizer;
+import jalview.util.MessageManager;
+
/**
* DOCUMENT ME!
*
@@ -54,7 +60,7 @@ public class EBIFetchClient
public String[] getSupportedDBs()
{
// TODO - implement rest call for dbfetch getSupportedDBs
- throw new Error("Not yet implemented");
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
}
/**
@@ -65,7 +71,7 @@ public class EBIFetchClient
public String[] getSupportedFormats()
{
// TODO - implement rest call for dbfetch getSupportedFormats
- throw new Error("Not yet implemented");
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
}
/**
@@ -76,9 +82,21 @@ public class EBIFetchClient
public String[] getSupportedStyles()
{
// TODO - implement rest call for dbfetch getSupportedStyles
- throw new Error("Not yet implemented");
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
}
+ /**
+ * Send an HTTP fetch request to EBI and save the reply in a temporary file.
+ *
+ * @param ids
+ * the query formatted as db:query1;query2;query3
+ * @param f
+ * the format wanted
+ * @param s
+ * - unused parameter
+ * @return the file holding the response
+ * @throws OutOfMemoryError
+ */
public File fetchDataAsFile(String ids, String f, String s)
throws OutOfMemoryError
{
@@ -107,7 +125,7 @@ public class EBIFetchClient
* @param f
* raw/xml
* @param s
- * ?
+ * not used - remove?
*
* @return Raw string array result of query set
*/
@@ -176,7 +194,7 @@ public class EBIFetchClient
+ db.toLowerCase() + "/" + ids.toLowerCase()
+ (f != null ? "/" + f : ""));
- BufferedInputStream is = new BufferedInputStream(rcall.openStream());
+ InputStream is = new BufferedInputStream(rcall.openStream());
if (outFile != null)
{
FileOutputStream fio = new FileOutputStream(outFile);
@@ -193,7 +211,7 @@ public class EBIFetchClient
{
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String rtn;
- ArrayList arl = new ArrayList();
+ List arl = new ArrayList();
while ((rtn = br.readLine()) != null)
{
arl.add(rtn);
@@ -219,10 +237,9 @@ public class EBIFetchClient
return null;
} finally
{
- //System.err.println("Took " + (System.currentTimeMillis() - time)
- // / 1000 + " secs for one call.");
+ // System.err.println("Took " + (System.currentTimeMillis() - time)
+ // / 1000 + " secs for one call.");
}
return null;
}
}
-