Class HiddenResourcesFilter
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.utils.HiddenResourcesFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class HiddenResourcesFilter extends java.lang.Object implements javax.servlet.FilterServlet filter blocking access to all configured resources. The purpose is to hide servlets which should be accessible only by internal forwards. To achieve this, this filter should be installed to protect them, with the request scope.- Author:
- K. Benedyczak
-
-
Constructor Summary
Constructors Constructor Description HiddenResourcesFilter(java.util.List<java.lang.String> protectedServletPaths)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProtectedPath(java.lang.String path)voiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)static booleanhasPathPrefix(java.lang.String pathInfo, java.lang.String prefix)static booleanhasPathPrefix(java.lang.String pathInfo, java.util.List<java.lang.String> prefixes)voidinit(javax.servlet.FilterConfig filterConfig)
-
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
hasPathPrefix
public static boolean hasPathPrefix(java.lang.String pathInfo, java.util.List<java.lang.String> prefixes)
-
hasPathPrefix
public static boolean hasPathPrefix(java.lang.String pathInfo, java.lang.String prefix)
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
addProtectedPath
public void addProtectedPath(java.lang.String path)
-
-