public abstract class HttpGitRepository extends Object
To expose a Git repository, bind this object to the URL space via stapler,
for example by adding a getter to your Action object.
| Constructor and Description |
|---|
HttpGitRepository() |
| Modifier and Type | Method and Description |
|---|---|
abstract org.eclipse.jgit.transport.ReceivePack |
createReceivePack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
Returns the
ReceivePack that handles "git push" from client. |
abstract org.eclipse.jgit.transport.UploadPack |
createUploadPack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
Returns the
UploadPack that handles "git fetch" from client. |
void |
doDynamic(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Handles git smart HTTP protocol.
|
protected org.eclipse.jgit.http.server.GitServlet |
init() |
abstract org.eclipse.jgit.lib.Repository |
openRepository()
Opens the repository this UI-bound object holds on to.
|
public abstract org.eclipse.jgit.lib.Repository openRepository()
throws IOException
IOExceptionpublic abstract org.eclipse.jgit.transport.ReceivePack createReceivePack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
throws org.eclipse.jgit.transport.resolver.ServiceNotEnabledException,
org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException
ReceivePack that handles "git push" from client.
The most basic implementation is the following, which allows anyone to push to this repository,
so normally you want some kind of access check before that. DefaultReceivePackFactory isn't suitable
here because it requires that the user has non-empty name, which isn't necessarily true in Jenkins
(for example, when the security is off entirely.)
return new ReceivePack(db);
org.eclipse.jgit.transport.resolver.ServiceNotEnabledExceptionorg.eclipse.jgit.transport.resolver.ServiceNotAuthorizedExceptionReceivePackFactory.create(Object, Repository)public abstract org.eclipse.jgit.transport.UploadPack createUploadPack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
throws org.eclipse.jgit.transport.resolver.ServiceNotEnabledException,
org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException
UploadPack that handles "git fetch" from client.
The most basic implementation is the following, which exposes this repository to everyone.
return new DefaultUploadPackFactory().create(context,db);
org.eclipse.jgit.transport.resolver.ServiceNotEnabledExceptionorg.eclipse.jgit.transport.resolver.ServiceNotAuthorizedExceptionUploadPackFactory.create(Object, Repository)protected org.eclipse.jgit.http.server.GitServlet init()
public void doDynamic(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionCopyright © 2016. All rights reserved.