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

com.nimbusds.openid.connect.provider.claims.source.spi.ServletInitContext Maven / Gradle / Ivy

There is a newer version: 1.2.8
Show newest version
package com.nimbusds.openid.connect.provider.claims.source.spi;


import java.io.InputStream;

import javax.servlet.ServletContext;


/**
 * Servlet-based initialisation context.
 */
public class ServletInitContext implements InitContext {


	/**
	 * The servlet context.
	 */
	private final ServletContext servletContext;


	/**
	 * Creates a new servlet-based initialisation context.
	 *
	 * @param servletContext The servlet context. Must not be {@code null}.
	 */
	public ServletInitContext(final ServletContext servletContext) {

		if (servletContext == null)
			throw new IllegalArgumentException("The servlet context must not be null");

		this.servletContext = servletContext;
	}


	/**
	 * Returns the servlet context.
	 *
	 * @return The servlet context.
	 */
	public ServletContext getServletContext() {

		return servletContext;
	}


	@Override
	public InputStream getResourceAsStream(final String path) {

		return servletContext.getResourceAsStream(path);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy