public final class TestRepositoryResolver extends java.lang.Object implements RepositoryResolver<javax.servlet.http.HttpServletRequest>
Modifier and Type | Field and Description |
---|---|
private TestRepository<Repository> |
repo |
private java.lang.String |
repoName |
NONE
Constructor and Description |
---|
TestRepositoryResolver(TestRepository<Repository> repo,
java.lang.String repoName)
Create a new
TestRepositoryResolver
that resolves the given name to the given repository. |
Modifier and Type | Method and Description |
---|---|
Repository |
open(javax.servlet.http.HttpServletRequest req,
java.lang.String name)
Locate and open a reference to a
Repository . |
private final TestRepository<Repository> repo
private final java.lang.String repoName
public TestRepositoryResolver(TestRepository<Repository> repo, java.lang.String repoName)
TestRepositoryResolver
that resolves the given name to the given repository.repo
- to resolve torepoName
- to matchpublic Repository open(javax.servlet.http.HttpServletRequest req, java.lang.String name) throws RepositoryNotFoundException, ServiceNotEnabledException
Repository
.
The caller is responsible for closing the returned Repository.
open
in interface RepositoryResolver<javax.servlet.http.HttpServletRequest>
req
- the current request, may be used to inspect session state
including cookies or user authentication.name
- name of the repository, as parsed out of the URL.RepositoryNotFoundException
- the repository does not exist or the name is incorrectly
formatted as a repository name.ServiceNotEnabledException
- the repository may exist, but HTTP access is not allowed on the
target repository, for the current user.