import jalview.datamodel.SequenceI;
import jalview.datamodel.UniprotEntry;
import jalview.datamodel.UniprotFile;
-import jalview.ws.ebi.EBIFetchClient;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
-import java.io.File;
-import java.io.FileReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.Reader;
import java.net.URL;
+import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Vector;
queries = queries.toUpperCase().replaceAll(
"(UNIPROT\\|?|UNIPROT_|UNIREF\\d+_|UNIREF\\d+\\|?)", "");
AlignmentI al = null;
- EBIFetchClient ebi = new EBIFetchClient();
- // uniprotxml parameter required since december 2007
- // uniprotkb dbname changed introduced december 2008
- File file = ebi.fetchDataAsFile("uniprotkb:" + queries, "uniprotxml",
- "xml");
+
+ String downloadstring = "http://www.uniprot.org/uniprot/" + queries
+ + ".xml";
+ URL url = null;
+ URLConnection urlconn = null;
+
+ url = new URL(downloadstring);
+ urlconn = url.openConnection();
+ InputStream istr = urlconn.getInputStream();
Vector<UniprotEntry> entries = getUniprotEntries(
- new FileReader(file));
+ new InputStreamReader(istr, "UTF-8"));
if (entries != null)
{
- ArrayList<SequenceI> seqs = new ArrayList<SequenceI>();
+ ArrayList<SequenceI> seqs = new ArrayList<>();
for (UniprotEntry entry : entries)
{
seqs.add(uniprotEntryToSequenceI(entry));
return al;
} catch (Exception e)
{
- stopQuery();
throw (e);
+ } finally
+ {
+ stopQuery();
}
}