|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jgit.http.server.resolver.AsIsFileService
public class AsIsFileService
Controls access to bare files in a repository.
Older HTTP clients which do not speak the smart HTTP variant of the Git
protocol fetch from a repository by directly getting its objects and pack
files. This class, along with the http.getanyfile
per-repository
configuration setting, can be used by GitServlet
to control whether
or not these older clients are permitted to read these direct files.
Field Summary | |
---|---|
static AsIsFileService |
DISABLED
Always throws ServiceNotEnabledException . |
Constructor Summary | |
---|---|
AsIsFileService()
|
Method Summary | |
---|---|
void |
access(javax.servlet.http.HttpServletRequest req,
Repository db)
Determine if access to any bare file of the repository is allowed. |
protected static boolean |
isEnabled(Repository db)
Determine if http.getanyfile is enabled in the configuration. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final AsIsFileService DISABLED
ServiceNotEnabledException
.
Constructor Detail |
---|
public AsIsFileService()
Method Detail |
---|
protected static boolean isEnabled(Repository db)
http.getanyfile
is enabled in the configuration.
db
- the repository to check.
false
if http.getanyfile
was explicitly set to
false
in the repository's configuration file; otherwise
true
.public void access(javax.servlet.http.HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException
This method silently succeeds if the request is allowed, or fails by throwing a checked exception if access should be denied.
The default implementation of this method checks http.getanyfile
,
throwing ServiceNotEnabledException
if it was explicitly set to
false
, and otherwise succeeding silently.
req
- current HTTP request, in case information from the request may
help determine the access request.db
- the repository the request would obtain a bare file from.
ServiceNotEnabledException
- bare file access is not allowed on the target repository, by
any user, for any reason.
ServiceNotAuthorizedException
- bare file access is not allowed for this HTTP request and
repository, such as due to a permission error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |