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

cat.inspiracio.servlet.InitialServletContext Maven / Gradle / Ivy

Go to download

Dummy Servlet provides some implementations for the interfaces and classes of the Java Servlet spec that are useful for testing and simulation. Version 5.0.0 is for Servlet 5.0.0.

The newest version!
/*
Copyright 2016 Alexander Bunkenburg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cat.inspiracio.servlet;

import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.EventListener;
import java.util.Map;
import java.util.Set;

import jakarta.servlet.*;
import jakarta.servlet.descriptor.JspConfigDescriptor;

/** All methods throw RuntimeException. */
public class InitialServletContext implements ServletContext {

	/** Make one. */
	public InitialServletContext(){}

	@Override public ServletContext getContext(String uripath){throw new RuntimeException();}
	@Override public String getContextPath(){throw new RuntimeException();}
	@Override public int getMajorVersion(){throw new RuntimeException();}
	@Override public int getMinorVersion(){throw new RuntimeException();}

	@Override public String getMimeType(String file){throw new RuntimeException();}
	@Override public Set getResourcePaths(String path){throw new RuntimeException();}
	@Override public URL getResource(String path)throws MalformedURLException{throw new RuntimeException();}
	@Override public InputStream getResourceAsStream(String path){throw new RuntimeException();}
	@Override public RequestDispatcher getRequestDispatcher(String path){throw new RuntimeException();}
	@Override public RequestDispatcher getNamedDispatcher(String name){throw new RuntimeException();}
	@Override public void log(String msg){throw new RuntimeException();}
	@Override public void log(String message, Throwable throwable){throw new RuntimeException();}
	@Override public String getRealPath(String path){throw new RuntimeException();}
	@Override public String getServerInfo(){throw new RuntimeException();}
	@Override public String getInitParameter(String name){throw new RuntimeException();}
	@Override public Enumeration getInitParameterNames(){throw new RuntimeException();}

	@Override public Object getAttribute(String name){throw new RuntimeException();}
	@Override public Enumeration getAttributeNames(){throw new RuntimeException();}
	@Override public void setAttribute(String name, Object object){throw new RuntimeException();}
	@Override public void removeAttribute(String name){throw new RuntimeException();}
	@Override public String getServletContextName(){throw new RuntimeException();}

	// Servlet Spec 3.0

	@Override public boolean setInitParameter(String name, String value){throw new RuntimeException();}
	@Override public int getEffectiveMajorVersion(){throw new RuntimeException();}
	@Override public int getEffectiveMinorVersion(){throw new RuntimeException();}
	@Override public ServletRegistration.Dynamic addServlet(String servletName, String className){throw new RuntimeException();}
	@Override public ServletRegistration.Dynamic addServlet(String s, Servlet servlet){throw new RuntimeException();}
	@Override public ServletRegistration.Dynamic addServlet(String s, Class aClass){throw new RuntimeException();}
	@Override public  T createServlet(Class aClass) throws ServletException {throw new RuntimeException();}
	@Override public ServletRegistration getServletRegistration(String servletName){throw new RuntimeException();}
	@Override public Map getServletRegistrations(){throw new RuntimeException();}
	@Override public FilterRegistration.Dynamic addFilter(String filterName, String className){throw new RuntimeException();}
	@Override public FilterRegistration.Dynamic addFilter(String filterName, Filter filter){throw new RuntimeException();}
	@Override public FilterRegistration.Dynamic addFilter(String filterName, Class filterClass){throw new RuntimeException();}
	@Override public  T createFilter(Class aClass) throws ServletException {throw new RuntimeException();}
	@Override public FilterRegistration getFilterRegistration(String filterName){throw new RuntimeException();}
	@Override public Map getFilterRegistrations(){throw new RuntimeException();}
	@Override public SessionCookieConfig getSessionCookieConfig(){throw new RuntimeException();}
	@Override public void setSessionTrackingModes(Set set){throw new RuntimeException();}
	@Override public Set getDefaultSessionTrackingModes(){throw new RuntimeException();}
	@Override public Set getEffectiveSessionTrackingModes(){throw new RuntimeException();}
	@Override public void addListener(String className){throw new RuntimeException();}
	@Override public  void addListener(T t){throw new RuntimeException();}
	@Override public void addListener(Class filterClass){throw new RuntimeException();}
	@Override public  T createListener(Class filterClass) throws ServletException {throw new RuntimeException();}
	@Override public JspConfigDescriptor getJspConfigDescriptor(){throw new RuntimeException();}
	@Override public ClassLoader getClassLoader(){throw new RuntimeException();}
	@Override public void declareRoles(String... roleNames){throw new RuntimeException();}

	// Servlet Spec 3.1.

	@Override public String getVirtualServerName(){throw new RuntimeException();}

	// Servlet 3.0.0

	@Override public ServletRegistration.Dynamic addJspFile(String s, String s1) {throw new RuntimeException();}
	@Override public int getSessionTimeout() {throw new RuntimeException();}
	@Override public void setSessionTimeout(int i) {throw new RuntimeException();}
	@Override public String getRequestCharacterEncoding() {throw new RuntimeException();}
	@Override public void setRequestCharacterEncoding(String s) {throw new RuntimeException();}
	@Override public String getResponseCharacterEncoding() {throw new RuntimeException();}
	@Override public void setResponseCharacterEncoding(String s) {throw new RuntimeException();}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy