public abstract class FileBackedHttpGitRepository extends HttpGitRepository
HttpGitRepository where the repository
is non-bare, resides in a directory local to the master, and you maintain
the local up-to-date checkout whenever a change is pushed.| Modifier and Type | Field and Description |
|---|---|
File |
workspace
Directory of the local workspace on the master.
|
| Modifier | Constructor and Description |
|---|---|
protected |
FileBackedHttpGitRepository(File workspace) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
checkPushPermission()
Do something like
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER)
to make sure the user has the permission to push. |
protected void |
createInitialRepository(org.eclipse.jgit.lib.Repository r)
Called when there's no .git directory to create one.
|
org.eclipse.jgit.transport.ReceivePack |
createReceivePack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
Requires the admin access to be able to push
|
org.eclipse.jgit.transport.ReceivePack |
createReceivePack(org.eclipse.jgit.lib.Repository db) |
org.eclipse.jgit.transport.UploadPack |
createUploadPack(javax.servlet.http.HttpServletRequest context,
org.eclipse.jgit.lib.Repository db)
This default implementation allows read access to anyone
who can access the HTTP URL this repository is bound to.
|
org.eclipse.jgit.lib.Repository |
openRepository()
Opens the repository this UI-bound object holds on to.
|
protected void |
updateWorkspace(org.eclipse.jgit.lib.Repository repo)
Called when new ref is pushed to update the local workspace.
|
doDynamic, initpublic final File workspace
protected FileBackedHttpGitRepository(File workspace)
public org.eclipse.jgit.lib.Repository openRepository()
throws IOException
HttpGitRepositoryopenRepository in class HttpGitRepositoryIOExceptionprotected void createInitialRepository(org.eclipse.jgit.lib.Repository r)
throws IOException
IOExceptionpublic 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
createUploadPack in class HttpGitRepositoryorg.eclipse.jgit.transport.resolver.ServiceNotEnabledExceptionorg.eclipse.jgit.transport.resolver.ServiceNotAuthorizedExceptionUploadPackFactory.create(Object, Repository)public 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
createReceivePack in class HttpGitRepositoryorg.eclipse.jgit.transport.resolver.ServiceNotEnabledExceptionorg.eclipse.jgit.transport.resolver.ServiceNotAuthorizedExceptionReceivePackFactory.create(Object, Repository)public org.eclipse.jgit.transport.ReceivePack createReceivePack(org.eclipse.jgit.lib.Repository db)
protected void updateWorkspace(org.eclipse.jgit.lib.Repository repo)
throws IOException,
org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionprotected abstract void checkPushPermission()
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER)
to make sure the user has the permission to push.Copyright © 2016. All rights reserved.