From 89aeaf90b1b2aeb700effa1b9bb32245c326a1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Thu, 8 Feb 2018 11:06:27 +0100 Subject: [PATCH] some cosmetic changes --- build.gradle | 5 +++-- .../main/java/org/xbib/content/rdf/RdfXContent.java | 4 ++-- .../org/xbib/content/rdf/RdfXContentGenerator.java | 10 +++++++--- .../xbib/content/rdf/io/xml/XmlContentGenerator.java | 7 +++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 5519727..6b5783b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id "org.xbib.gradle.plugin.asciidoctor" version "1.5.6.0.1" } -printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" + +printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\n\nGradle: %s Groovy: %s Java: %s\n" + "Build: group: ${project.group} name: ${project.name} version: ${project.version}\n", InetAddress.getLocalHost(), System.getProperty("os.name"), @@ -15,8 +15,9 @@ printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" + System.getProperty("java.vm.version"), System.getProperty("java.vm.vendor"), System.getProperty("java.vm.name"), + gradle.gradleVersion, GroovySystem.getVersion(), - gradle.gradleVersion + JavaVersion.current() apply plugin: 'build-dashboard' apply plugin: "io.codearte.nexus-staging" diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContent.java b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContent.java index 7f8998b..55e7c80 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContent.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContent.java @@ -28,12 +28,12 @@ public class RdfXContent implements RdfContent { } @Override - public RdfContentGenerator createGenerator(OutputStream out) throws IOException { + public RdfContentGenerator createGenerator(OutputStream out) { return new RdfXContentGenerator<>(out); } @Override - public RdfContentParser createParser(InputStream in) throws IOException { + public RdfContentParser createParser(InputStream in) { throw new UnsupportedOperationException(); } } diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java index b54cc1e..6ff86f9 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/RdfXContentGenerator.java @@ -19,12 +19,16 @@ import java.util.List; public class RdfXContentGenerator

implements RdfContentGenerator

{ protected final OutputStream out; + protected Resource resource; + protected XContentBuilder builder; + private P params; + private boolean flushed; - RdfXContentGenerator(OutputStream out) throws IOException { + RdfXContentGenerator(OutputStream out) { this.out = out; } @@ -112,14 +116,14 @@ public class RdfXContentGenerator

implements RdfCon return this; } - public String string() throws IOException { + public String string() { if (builder != null) { return builder.string(); } return null; } - public String get() throws IOException { + public String get() { return string(); } diff --git a/content-rdf/src/main/java/org/xbib/content/rdf/io/xml/XmlContentGenerator.java b/content-rdf/src/main/java/org/xbib/content/rdf/io/xml/XmlContentGenerator.java index a03f456..d33c1db 100644 --- a/content-rdf/src/main/java/org/xbib/content/rdf/io/xml/XmlContentGenerator.java +++ b/content-rdf/src/main/java/org/xbib/content/rdf/io/xml/XmlContentGenerator.java @@ -29,17 +29,20 @@ import javax.xml.stream.util.XMLEventConsumer; public class XmlContentGenerator implements RdfContentGenerator, Flushable, XmlConstants { private static final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); + private static final XMLEventFactory eventFactory = XMLEventFactory.newInstance(); + private final Writer writer; + private Resource resource; private XmlContentParams params = XmlContentParams.XML_CONTENT_PARAMS; - public XmlContentGenerator(OutputStream out) throws IOException { + public XmlContentGenerator(OutputStream out) { this(new OutputStreamWriter(out, StandardCharsets.UTF_8)); } - public XmlContentGenerator(Writer writer) throws IOException { + public XmlContentGenerator(Writer writer) { this.writer = writer; }