[
https://issues.apache.org/jira/browse/JENA-1454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16302608#comment-16302608
]
ASF GitHub Bot commented on JENA-1454:
--------------------------------------
Github user kinow commented on a diff in the pull request:
https://github.com/apache/jena/pull/334#discussion_r158590480
--- Diff:
jena-arq/src/main/java/org/apache/jena/riot/resultset/rw/ResultsWriter.java ---
@@ -77,19 +79,33 @@ private ResultsWriter(Lang lang, Context context) {
this.context = context;
}
- public void write(String url, ResultSet resultSet) {
- throw new NotImplemented();
+ /** Write a result set, using the configurartion of the {@code
ResultWriter}, to a file */
+ public void write(String filename, ResultSet resultSet) {
+ Objects.requireNonNull(filename);
+ Objects.requireNonNull(resultSet);
+ try ( OutputStream out = openURL(filename) ) {
+ write(out, resultSet);
+ } catch (IOException ex) { IO.exception(ex); }
}
+ /** Write a result set, using the configurartion of the {@code
ResultWriter}, to an {@code OutputStream}. */
public void write(OutputStream output, ResultSet resultSet) {
+ Objects.requireNonNull(output);
+ Objects.requireNonNull(resultSet);
write(output, resultSet, null, lang);
}
- public void write(String url, boolean booleanResult) {
- throw new NotImplemented();
+ /** Write a boolean result, using the configurartion of the {@code
ResultWriter}, to a file */
+ public void write(String filename, boolean booleanResult) {
+ Objects.requireNonNull(booleanResult);
--- End diff --
Only minor nit-pick I found reviewing the commits added after my previous
comment was here.
`write(String filename, ResultSet resultSet)` has
`requireNonNull(filename)`, and `requireNonNull(resultSet)`. And in this method
the `filename` is not checked for null. Not sure if it is intentional or not.
> Configurable ResultSet reading and writing
> ------------------------------------------
>
> Key: JENA-1454
> URL: https://issues.apache.org/jira/browse/JENA-1454
> Project: Apache Jena
> Issue Type: Improvement
> Reporter: Andy Seaborne
> Assignee: Andy Seaborne
> Priority: Minor
>
> Same patterns as {{RDFParser}}, {{RDFWriter}}.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)