Skip to content
Snippets Groups Projects
Commit 2b312996 authored by Henry Borasch's avatar Henry Borasch
Browse files

982: slimmed schema loading logic

parent 714a24c9
No related branches found
No related tags found
No related merge requests found
...@@ -136,32 +136,28 @@ public class SchemaResourceProvider implements SchemaProvider { ...@@ -136,32 +136,28 @@ public class SchemaResourceProvider implements SchemaProvider {
private void addSetSchema(final String schema) { private void addSetSchema(final String schema) {
Optional<URI> schemaId = readIdFromSchema(schema); readIdFromSchema(schema).ifPresentOrElse(
schemaId.ifPresentOrElse(
id -> setSchemas.put(id, schema), id -> setSchemas.put(id, schema),
() -> LOGGER.warn("File '" + schema + "' does not provide a valid set schema and will be ignored.")); () -> LOGGER.warn("File '" + schema + "' does not provide a valid set schema and will be ignored."));
} }
private void addMetadataSchema(final String schema) { private void addMetadataSchema(final String schema) {
Optional<URI> schemaId = readIdFromSchema(schema); readIdFromSchema(schema).ifPresentOrElse(
schemaId.ifPresentOrElse(
id -> metadataSchemas.put(id, schema), id -> metadataSchemas.put(id, schema),
() -> LOGGER.warn("File '" + schema + "' does not provide a valid metadata schema and will be ignored.")); () -> LOGGER.warn("File '" + schema + "' does not provide a valid metadata schema and will be ignored."));
} }
private void addDestinationSchema(final String schema) { private void addDestinationSchema(final String schema) {
Optional<URI> schemaId = readIdFromSchema(schema); readIdFromSchema(schema).ifPresentOrElse(
schemaId.ifPresentOrElse(
id -> destinationSchemas.put(id, schema), id -> destinationSchemas.put(id, schema),
() -> LOGGER.warn("File '" + schema + "' does not provide a valid destination schema and will be ignored.")); () -> LOGGER.warn("File '" + schema + "' does not provide a valid destination schema and will be ignored."));
} }
private void addSubmissionDataSchema(final String schema) { private void addSubmissionDataSchema(final String schema) {
Optional<URI> schemaId = readIdFromSchema(schema); readIdFromSchema(schema).ifPresentOrElse(
schemaId.ifPresentOrElse(
id -> submissionDataSchemas.put(id, schema), id -> submissionDataSchemas.put(id, schema),
() -> LOGGER.warn("File '" + schema + "' does not provide a valid submission data schema and will be ignored.")); () -> LOGGER.warn("File '" + schema + "' does not provide a valid submission data schema and will be ignored."));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment