Skip to content

Commit

Permalink
Also use the token with rdf.importURL when logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 11, 2011
1 parent 58a7da2 commit fbed2f4
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -193,9 +193,14 @@ public List<String> listDataSets(String service, IProgressMonitor monitor)

IRDFStore store = rdf.createInMemoryStore();
List<String> dataSets = Collections.emptyList();
Map<String, String> extraHeaders = new HashMap<String, String>();
String token = Activator.getToken();
if (token != null) {
extraHeaders.put("subjectid", Activator.getToken());
}
try {
// download the list of data sets as RDF
rdf.importURL(store, service + "dataset", monitor);
rdf.importURL(store, service + "dataset", extraHeaders, monitor);
String dump = rdf.asRDFN3(store);
System.out.println("RDF: " + dump);
monitor.worked(1);
Expand Down Expand Up @@ -400,10 +405,16 @@ public List<Integer> listCompounds(String service, Integer dataSet,
monitor.beginTask("Looking up compound identifiers...", 3);
IRDFStore store = rdf.createInMemoryStore();
try {
Map<String, String> extraHeaders = new HashMap<String, String>();
String token = Activator.getToken();
if (token != null) {
extraHeaders.put("subjectid", Activator.getToken());
}
// download the list of compounds as RDF
rdf.importURL(
store,
service + "dataset/" + dataSet + "/compound",
extraHeaders,
monitor
);
monitor.worked(1);
Expand Down

0 comments on commit fbed2f4

Please sign in to comment.