Package org.eclipse.jgit.http.server
Class RepositoryFilter
- java.lang.Object
-
- org.eclipse.jgit.http.server.RepositoryFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class RepositoryFilter extends Object implements javax.servlet.Filter
Open a repository named by the path info throughRepositoryResolver
.This filter assumes it is invoked by
GitServlet
and is likely to not work as expected if called from any other class. This filter assumes the path info of the current request is a repository name which can be used by the configuredRepositoryResolver
to open aRepository
and attach it to the current request.This filter sets request attribute
ServletUtils.ATTRIBUTE_REPOSITORY
when it discovers the repository, and automatically closes and removes the attribute when the request is complete.
-
-
Constructor Summary
Constructors Constructor Description RepositoryFilter(RepositoryResolver<javax.servlet.http.HttpServletRequest> resolver)
Create a new filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
void
doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
void
init(javax.servlet.FilterConfig config)
-
-
-
Constructor Detail
-
RepositoryFilter
public RepositoryFilter(RepositoryResolver<javax.servlet.http.HttpServletRequest> resolver)
Create a new filter.- Parameters:
resolver
- the resolver which will be used to translate the URL name component to the actualRepository
instance for the current web request.
-
-
Method Detail
-
init
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
- Specified by:
init
in interfacejavax.servlet.Filter
- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
-