001package com.nimbusds.openid.connect.provider.spi;
002
003
004import java.io.InputStream;
005
006
007/**
008 * Context for the initialisation of SPI implementations. Provides a method to
009 * retrieve a configuration or another file from the web application.
010 *
011 * <p>Example use: Initialisation of OpenID Connect claims sources in the
012 * Connect2id server.
013 */
014public interface InitContext {
015
016
017        /**
018         * Returns the resource located at the named path as an input stream.
019         * Has the same behaviour as
020         * {@link javax.servlet.ServletContext#getResourceAsStream}.
021         *
022         * @param path The path to the resource, must be begin with a '/' and
023         *             is interpreted as relative to the web application root.
024         *             Must not be {@code null}.
025         *
026         * @return The resource as an input stream, or {@code null} if no
027         *         resource exists at the specified path.
028         */
029        public InputStream getResourceAsStream(final String path);
030}
031