- vals.add(new BasicNameValuePair("format", "rnaml"));
- java.net.URL geturl = new URL(twoDtoolsURL+"?tool=rnaview&output=rnaml&pdbid="+pdbid);
- return processJsonResponseFor(new InputStreamReader(geturl.openStream()));
+ vals.add(new BasicNameValuePair("output", "rnaml"));
+ java.net.URL geturl = new URL(twoDtoolsURL + "?tool=rnaview&pdbid="
+ + pdbid + "&output=rnaml");
+ // return processJsonResponseFor(new
+ // InputStreamReader(geturl.openStream()));
+ ArrayList<Reader> readers = new ArrayList<>();
+ readers.add(new InputStreamReader(geturl.openStream()));
+ return readers.iterator();
+ }
+
+}
+
+class RvalsIterator implements Iterator, AutoCloseable
+{
+ private Iterator<Object> rvals;
+
+ @SuppressWarnings("unchecked")
+ protected RvalsIterator(Reader respons) throws IOException, ParseException
+ {
+ /*
+ * as in 2.11.1 (pre-JalviewJS)
+ */
+ // final JSONArray responses = (JSONArray) jp.parse(respons);
+ // this.rvals = responses.iterator();
+
+ /*
+ * as in JalviewJS (with comment that this code is never called)
+ */
+ this.rvals = ((List<Object>) JSONUtils.parse(respons)).iterator();