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
Opens a repository named by the path info through RepositoryResolver.
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
configured RepositoryResolver to open a Repository 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.
|
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig config)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 actual Repository instance for the
current web request.
init
public void init(javax.servlet.FilterConfig config)
throws javax.servlet.ServletException
- Specified by:
init in interface javax.servlet.Filter
- Throws:
javax.servlet.ServletException
destroy
public void destroy()
- Specified by:
destroy in interface javax.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 interface javax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
Copyright © 2011. All Rights Reserved.