ckanApiBase = ckanApiBase.trim();
if(ckanApiBase.endsWith("/")){
ckanApiBase = ckanApiBase.substring(0, ckanApiBase.length()-1);
}
CkanApiProxy ckanApiClient = new CkanApiProxy();
Engine engine = getEngine(request, project);
StringTokenizer tokenizer = new StringTokenizer(files, ",");
Set<Exporter> exporters = new HashSet<Exporter>();
while(tokenizer.hasMoreTokens()){
String format = tokenizer.nextToken();
Exporter exporter = ExporterRegistry.getExporter(format);
if(exporter==null){
//handle the specialcase of provenance
if(format.equals("add_provenance_info")){
addProvenanceInfo = true;
continue;
}
//either JSON representation of the history or something went wrong
if(format.equals("history-json")){
exporter = new HistoryJsonExporter();
}else{
//fail
respondException(response, new RuntimeException("Unknown exporter format"));
return;
}
}
exporters.add(exporter);
}
final String packageUrl = ckanApiClient.addGroupOfResources(ckanApiBase , packageId, exporters, project, engine,
new ProvenanceFactory(), apikey, createNewIfNonExisitng, addProvenanceInfo);
respondJSON(response, new Jsonizable() {
@Override
public void write(JSONWriter writer, Properties options)