X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Febi%2FEBIFetchClient.java;h=3c9e6b4e44e75f994d59e21a7a6f626443bd5434;hb=838e4f91d4a53dd315640dbc9ff6ef7a815ee576;hp=cb61cd49f2403c8cc4f3b8894c85f2789a6ffb96;hpb=ad15cff29620f960119f80176f1fd443da9f6763;p=jalview.git diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index cb61cd4..3c9e6b4 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -26,9 +26,11 @@ 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; /** @@ -83,6 +85,18 @@ public class EBIFetchClient 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 { @@ -111,7 +125,7 @@ public class EBIFetchClient * @param f * raw/xml * @param s - * ? + * not used - remove? * * @return Raw string array result of query set */ @@ -180,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); @@ -197,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);