Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Raphael
histream
Commits
5eebe91b
Commit
5eebe91b
authored
Sep 11, 2018
by
R.W.Majeed
Browse files
static function for API use of XMLExport
parent
6c23d342
Changes
1
Hide whitespace changes
Inline
Side-by-side
histream-import/src/main/java/de/sekmi/histream/etl/XMLExport.java
View file @
5eebe91b
package
de.sekmi.histream.etl
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.net.URL
;
import
java.nio.file.Paths
;
import
javax.xml.stream.XMLStreamException
;
import
de.sekmi.histream.impl.Meta
;
import
de.sekmi.histream.io.GroupedXMLWriter
;
...
...
@@ -26,11 +30,15 @@ public class XMLExport {
System
.
err
.
println
(
"Usage: XMLExport <import-descriptor-file>"
);
System
.
exit
(-
1
);
}
ETLObservationSupplier
suppl
=
ETLObservationSupplier
.
load
(
Paths
.
get
(
args
[
0
]).
toUri
().
toURL
());
GroupedXMLWriter
writer
=
new
GroupedXMLWriter
(
System
.
out
);
descriptorToXML
(
Paths
.
get
(
args
[
0
]).
toUri
().
toURL
(),
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
);
Streams
.
transfer
(
suppl
,
writer
);
suppl
.
close
();
writer
.
close
();
writer
.
close
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment