X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fparadise%2FAnnotate3D.java;h=5b75206147a3fc549f58ed6f3cf31b03764450d4;hb=61ba3fbbcf553e5945051ae4f7ab185ddd2e6dca;hp=66a3564dcb86c6d6e111c0749920d56a9eee741b;hpb=ab43013b7e357b84b4abade0dba949668dfb2a0e;p=jalview.git diff --git a/src/jalview/ext/paradise/Annotate3D.java b/src/jalview/ext/paradise/Annotate3D.java index 66a3564..5b75206 100644 --- a/src/jalview/ext/paradise/Annotate3D.java +++ b/src/jalview/ext/paradise/Annotate3D.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) - * 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. * @@ -23,13 +23,13 @@ package jalview.ext.paradise; import jalview.util.MessageManager; import jalview.ws.HttpClientUtils; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringReader; import java.net.URL; import java.util.ArrayList; -import java.util.Collection; import java.util.Iterator; import java.util.List; @@ -37,7 +37,6 @@ import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.simple.JSONArray; import org.json.simple.JSONObject; -import org.json.simple.JSONStreamAware; import org.json.simple.parser.ContentHandler; import org.json.simple.parser.ParseException; @@ -46,13 +45,20 @@ import org.json.simple.parser.ParseException; * * @author jimp * - * History: v1.0 revised from original due to refactoring of - * paradise-ubmc.u-strasbg.fr/webservices/annotate3d to - * http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnaview + * @version v1.0 revised from original due to refactoring of + * paradise-ubmc.u-strasbg.fr/webservices/annotate3d to + * http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnaview
+ * See also testing URL from fjossinet:
+ * http://charn2-ibmc.u-strasbg.fr:8080/api/compute/2d
+ * If in doubt, check against the REST client at: + * https://github.com/fjossinet/RNA-Science + * -Toolbox/blob/master/pyrna/restclient.py */ public class Annotate3D { - private static String twoDtoolsURL = "http://arn-ibmc.in2p3.fr/api/compute/2d"; + // also test with + // "http://charn2-ibmc.u-strasbg.fr:8080/api/compute/2d"; + private static String twoDtoolsURL = "http://arn-ibmc.in2p3.fr/api/compute/2d?tool=rnaview"; private static ContentHandler createContentHandler() { @@ -138,7 +144,9 @@ public class Annotate3D // return processJsonResponseFor(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, // vals)); ArrayList readers = new ArrayList(); - readers.add(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, vals)); + final BufferedReader postResponse = HttpClientUtils.doHttpUrlPost( + twoDtoolsURL, vals, 0, 0); + readers.add(postResponse); return readers.iterator(); } @@ -190,14 +198,16 @@ public class Annotate3D @Override public void remove() { - throw new Error(MessageManager.getString("error.not_implemented_remove")); + throw new Error( + MessageManager.getString("error.not_implemented_remove")); } @Override protected Object clone() throws CloneNotSupportedException { - throw new CloneNotSupportedException(MessageManager.getString("error.not_implemented_clone")); + throw new CloneNotSupportedException( + MessageManager.getString("error.not_implemented_clone")); } @Override @@ -218,7 +228,10 @@ public class Annotate3D }; } catch (Exception foo) { - throw new Exception(MessageManager.getString("exception.couldnt_parse_responde_from_annotated3d_server"), foo); + throw new Exception( + MessageManager + .getString("exception.couldnt_parse_responde_from_annotated3d_server"), + foo); } }