/*
- * 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 2.9.0b1)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.ws.ebi;
+import jalview.util.MessageManager;
+
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;
/**
public String[] getSupportedDBs()
{
// TODO - implement rest call for dbfetch getSupportedDBs
- throw new Error("Not yet implemented");
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
}
/**
public String[] getSupportedFormats()
{
// TODO - implement rest call for dbfetch getSupportedFormats
- throw new Error("Not yet implemented");
+ throw new Error(MessageManager.getString("error.not_yet_implemented"));
}
/**
public String[] getSupportedStyles()
{
// TODO - implement rest call for dbfetch getSupportedStyles
- throw new Error("Not yet implemented");
+ 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
{
* @param f
* raw/xml
* @param s
- * ?
+ * not used - remove?
*
* @return Raw string array result of query set
*/
+ 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);
{
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String rtn;
- ArrayList<String> arl = new ArrayList<String>();
+ List<String> arl = new ArrayList<String>();
while ((rtn = br.readLine()) != null)
{
arl.add(rtn);
return null;
} finally
{
- //System.err.println("Took " + (System.currentTimeMillis() - time)
- // / 1000 + " secs for one call.");
+ // System.err.println("Took " + (System.currentTimeMillis() - time)
+ // / 1000 + " secs for one call.");
}
return null;
}
}
-