diff --git a/api/src/main/java/org/semanticweb/owlapi/io/AbstractOWLParser.java b/api/src/main/java/org/semanticweb/owlapi/io/AbstractOWLParser.java index aaf59623c2..02fc5b710e 100644 --- a/api/src/main/java/org/semanticweb/owlapi/io/AbstractOWLParser.java +++ b/api/src/main/java/org/semanticweb/owlapi/io/AbstractOWLParser.java @@ -12,6 +12,7 @@ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package org.semanticweb.owlapi.io; +import java.io.IOException; import java.io.Reader; import java.io.Serializable; import org.semanticweb.owlapi.model.OWLOntologyLoaderConfiguration; @@ -34,7 +35,7 @@ protected AbstractOWLParser() { @SuppressWarnings("resource") protected InputSource getInputSource(OWLOntologyDocumentSource source, OWLOntologyLoaderConfiguration config) - throws OWLOntologyInputSourceException { + throws IOException, OWLOntologyInputSourceException { Reader in = DocumentSources.wrapInputAsReader(source, config); InputSource is = new InputSource(in); is.setSystemId(source.getDocumentIRI().toString()); diff --git a/api/src/main/java/org/semanticweb/owlapi/io/DocumentSources.java b/api/src/main/java/org/semanticweb/owlapi/io/DocumentSources.java index a42eb0fb75..ff0fb84546 100644 --- a/api/src/main/java/org/semanticweb/owlapi/io/DocumentSources.java +++ b/api/src/main/java/org/semanticweb/owlapi/io/DocumentSources.java @@ -79,7 +79,7 @@ private DocumentSources() {} */ public static Reader wrapInputAsReader(OWLOntologyDocumentSource source, OWLOntologyLoaderConfiguration configuration, Charset encoding) - throws OWLOntologyInputSourceException { + throws IOException, OWLOntologyInputSourceException { Optional reader = source.getReader(); if (reader.isPresent()) { return new BufferedReader(reader.get()); @@ -101,7 +101,7 @@ public static Reader wrapInputAsReader(OWLOntologyDocumentSource source, * @throws OWLOntologyInputSourceException if an IO related exception is thrown. */ public static Reader wrapInputAsReader(OWLOntologyDocumentSource source, - OWLOntologyLoaderConfiguration configuration) throws OWLOntologyInputSourceException { + OWLOntologyLoaderConfiguration configuration) throws IOException, OWLOntologyInputSourceException { return wrapInputAsReader(source, configuration, StandardCharsets.UTF_8); } @@ -287,7 +287,7 @@ protected static InputStream connectWithFiveRetries(IRI documentIRI, * @param delegate delegate to wrap * @return wrapped input stream */ - public static InputStream wrap(InputStream delegate) { + public static InputStream wrap(InputStream delegate) throws IOException { checkNotNull(delegate, "delegate cannot be null"); return new BOMInputStream(delegate, ByteOrderMark.UTF_8, ByteOrderMark.UTF_16BE, ByteOrderMark.UTF_16LE, ByteOrderMark.UTF_32BE, ByteOrderMark.UTF_32LE);