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.Filter
Servlet 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 void
addProtectedPath(java.lang.String path)
void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
static boolean
hasPathPrefix(java.lang.String pathInfo, java.lang.String prefix)
static boolean
hasPathPrefix(java.lang.String pathInfo, java.util.List<java.lang.String> prefixes)
void
init(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:
doFilter
in interfacejavax.servlet.Filter
- Throws:
java.io.IOException
javax.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:
destroy
in interfacejavax.servlet.Filter
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
addProtectedPath
public void addProtectedPath(java.lang.String path)
-
-