All Downloads are FREE. Search and download functionalities are using the official Maven repository.

no.unit.nva.api.PublicationContext Maven / Gradle / Ivy

There is a newer version: 0.23.2
Show newest version
package no.unit.nva.api;

import static no.unit.nva.DatamodelConfig.dataModelObjectMapper;
import static nva.commons.core.ioutils.IoUtils.inputStreamFromResources;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException;

public class PublicationContext {

    public static final String CONTEXT_PATH = "publicationContext.json";
    public static final String CONTEXT_ERROR_MESSAGE = "Error processing context: ";

    public static JsonNode getContext() {
        try {
            return dataModelObjectMapper.readTree(inputStreamFromResources(CONTEXT_PATH));
        } catch (IOException e) {
            throw new IllegalStateException(CONTEXT_ERROR_MESSAGE + CONTEXT_PATH, e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy