X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Febi%2FEBIFetchClient.java;h=8aca9a2a4a948d0e2881f00727848dd5b058fb54;hb=9bfda76754fb426a471e1c12c9f0ca0c4c1784bc;hp=1f833d046e03f53e78083b0fa43ecc0f48284c41;hpb=1724567f3dfc3b4637aac7bdeb6633628e6a8335;p=jalview.git diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index 1f833d0..8aca9a2 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -136,8 +136,10 @@ public class EBIFetchClient String database = parseIds(ids, querystring); if (database == null) { - System.err.println("Invalid Query string : '" + ids + "'"); - System.err.println("Should be of form 'dbname:q1;q2;q3;q4'"); + jalview.bin.Console + .errPrintln("Invalid Query string : '" + ids + "'"); + jalview.bin.Console + .errPrintln("Should be of form 'dbname:q1;q2;q3;q4'"); return null; } @@ -227,20 +229,21 @@ public class EBIFetchClient } return (String[]) arl.toArray(); } - System.err.println( + jalview.bin.Console.errPrintln( "Warning: response code " + responseCode + " for " + url); } catch (OutOfMemoryError er) { - System.out.println("OUT OF MEMORY DOWNLOADING QUERY FROM " + database - + ":\n" + ids); + jalview.bin.Console.outPrintln("OUT OF MEMORY DOWNLOADING QUERY FROM " + + database + ":\n" + ids); throw er; } catch (Exception ex) { if (!ex.getMessage().startsWith( "uk.ac.ebi.jdbfetch.exceptions.DbfNoEntryFoundException")) { - System.err.println("Unexpected exception when retrieving from " - + database + "\nQuery was : '" + ids + "'"); + jalview.bin.Console + .errPrintln("Unexpected exception when retrieving from " + + database + "\nQuery was : '" + ids + "'"); ex.printStackTrace(System.err); } } finally @@ -266,9 +269,12 @@ public class EBIFetchClient } return null; } - static { + + static + { Platform.addJ2SDirectDatabaseCall("https://www.ebi.ac.uk/"); } + /** * Constructs the URL to fetch from * @@ -289,7 +295,8 @@ public class EBIFetchClient else { url = "https://www.ebi.ac.uk/Tools/dbfetch/dbfetch/" - + database.toLowerCase(Locale.ROOT) + "/" + ids.toLowerCase(Locale.ROOT) + + database.toLowerCase(Locale.ROOT) + "/" + + ids.toLowerCase(Locale.ROOT) + (format != null ? "/" + format : ""); } return url;