Commit 5eebe91b authored by R.W.Majeed's avatar R.W.Majeed
Browse files

static function for API use of XMLExport

parent 6c23d342
package de.sekmi.histream.etl; package de.sekmi.histream.etl;
import java.nio.file.Paths; import java.nio.file.Paths;
import de.sekmi.histream.impl.Meta; import de.sekmi.histream.impl.Meta;
import; import;
...@@ -26,8 +30,12 @@ public class XMLExport { ...@@ -26,8 +30,12 @@ public class XMLExport {
System.err.println("Usage: XMLExport <import-descriptor-file>"); System.err.println("Usage: XMLExport <import-descriptor-file>");
System.exit(-1); System.exit(-1);
} }
ETLObservationSupplier suppl = ETLObservationSupplier.load(Paths.get(args[0]).toUri().toURL()); descriptorToXML(Paths.get(args[0]).toUri().toURL(), System.out);
GroupedXMLWriter writer = new GroupedXMLWriter(System.out); }
public static void descriptorToXML(URL importDescriptor, OutputStream out) throws IOException, ParseException, XMLStreamException {
ETLObservationSupplier suppl = ETLObservationSupplier.load(importDescriptor);
GroupedXMLWriter writer = new GroupedXMLWriter(out);
Meta.transfer(suppl, writer); Meta.transfer(suppl, writer);
Streams.transfer(suppl, writer); Streams.transfer(suppl, writer);
suppl.close(); suppl.close();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment