diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/ImportException.java b/src/uloimport/src/main/java/info/kwarc/uloimport/ImportException.java new file mode 100644 index 0000000000000000000000000000000000000000..94ae3588e6adfccb7afe7fc43c5a3c60442c3eba --- /dev/null +++ b/src/uloimport/src/main/java/info/kwarc/uloimport/ImportException.java @@ -0,0 +1,26 @@ +package info.kwarc.uloimport; + +/** + * An Exception caused by an import of ULO/RDF data. + */ +public class ImportException extends RuntimeException { + /** + * Construct a new {@link ImportException} with just a message. + * + * @param message The message associated with this exception. + */ + public ImportException(String message) { + super(message); + } + + /** + * Construct a new {@link ImportException} with a message and a cause + * that caused this exception. + * + * @param message The message associated with this exception. + * @param cause The underlying cause of the import error. + */ + public ImportException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/src/uloimport/src/main/java/info/kwarc/uloimport/Importer.java b/src/uloimport/src/main/java/info/kwarc/uloimport/Importer.java new file mode 100644 index 0000000000000000000000000000000000000000..542a11ceb84aab118b35b199319b65a2a6d8eb0d --- /dev/null +++ b/src/uloimport/src/main/java/info/kwarc/uloimport/Importer.java @@ -0,0 +1,14 @@ +package info.kwarc.uloimport; + +import java.io.InputStream; + +public interface Importer { + /** + * Import the (single) ULO/RDF file at the given input stream to the + * storage underlying this {@link Importer}. + * + * @param is The stream from which to read a single ULO/RDF file. + * @throws ImportException When the import failed. + */ + void importUlo(InputStream is) throws ImportException; +}