/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * 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.
*
*/
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;
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;
*
* @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 <br/>
+ * See also testing URL from fjossinet:<br/>
+ * http://charn2-ibmc.u-strasbg.fr:8080/api/compute/2d <br/>
+ * 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()
{
// return processJsonResponseFor(HttpClientUtils.doHttpUrlPost(twoDtoolsURL,
// vals));
ArrayList<Reader> readers = new ArrayList<Reader>();
- readers.add(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, vals));
+ final BufferedReader postResponse = HttpClientUtils.doHttpUrlPost(
+ twoDtoolsURL, vals, 0, 0);
+ readers.add(postResponse);
return readers.iterator();
}
@Override
public void remove()
{
- throw new Error("Remove: Not implemented");
+ throw new Error(
+ MessageManager.getString("error.not_implemented_remove"));
}
@Override
protected Object clone() throws CloneNotSupportedException
{
- throw new CloneNotSupportedException("Clone: Not implemented");
+ throw new CloneNotSupportedException(
+ MessageManager.getString("error.not_implemented_clone"));
}
@Override
} catch (Exception foo)
{
throw new Exception(
- "Couldn't parse response from Annotate3d server.", foo);
+ MessageManager
+ .getString("exception.couldnt_parse_responde_from_annotated3d_server"),
+ foo);
}
}