public abstract class GitFacadeSupport extends MBeanSupport implements GitFacadeMXBean, GitFileManager
GitFacadeMXBean| Constructor and Description |
|---|
GitFacadeSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
checkoutBranch(org.eclipse.jgit.api.Git git,
String branch) |
protected org.eclipse.jgit.revwalk.RevCommit |
commitThenPush(org.eclipse.jgit.api.Git git,
String branch,
org.eclipse.jgit.api.CommitCommand commit) |
CommitInfo |
createCommitInfo(org.eclipse.jgit.revwalk.RevCommit entry) |
protected String |
defaultObjectId(org.eclipse.jgit.api.Git git,
String objectId) |
protected List<String> |
doCompletePath(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String completionText,
boolean directoriesOnly) |
protected void |
doCreateBranch(org.eclipse.jgit.api.Git git,
String fromBranch,
String newBranch) |
protected CommitInfo |
doCreateDirectory(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String path,
org.eclipse.jgit.lib.PersonIdent personIdent,
String commitMessage) |
protected String |
doDiff(org.eclipse.jgit.api.Git git,
String objectId,
String baseObjectId,
String pathOrBlobPath) |
protected FileInfo |
doExists(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty) |
protected FileInfo |
doExists(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty,
boolean caseSensitive) |
protected CommitInfo |
doGetCommitInfo(org.eclipse.jgit.api.Git git,
String commitId) |
protected List<CommitTreeInfo> |
doGetCommitTree(org.eclipse.jgit.api.Git git,
String commitId)
Returns the file changes in a commit
|
protected String |
doGetContent(org.eclipse.jgit.api.Git git,
String objectId,
String pathOrBlobPath) |
protected String |
doGetHead(org.eclipse.jgit.api.Git git) |
protected List<CommitInfo> |
doHistory(org.eclipse.jgit.api.Git git,
String branch,
String objectId,
String pathOrBlobPath,
int limit) |
protected List<String> |
doListBranches(org.eclipse.jgit.api.Git git) |
protected abstract Iterable<org.eclipse.jgit.transport.PushResult> |
doPush(org.eclipse.jgit.api.Git git) |
protected FileContents |
doRead(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty)
Reads the file contents from the currently checked out branch
|
protected <T> T |
doReadFile(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty,
Function<File,T> callback)
Performs a read only operation on the file
|
protected String |
doReadJsonChildContent(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String path,
String fileNameWildcard,
String search) |
protected org.eclipse.jgit.revwalk.RevCommit |
doRemove(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String path,
String commitMessage,
org.eclipse.jgit.lib.PersonIdent personIdent) |
protected org.eclipse.jgit.revwalk.RevCommit |
doRename(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String oldPath,
String newPath,
String commitMessage,
org.eclipse.jgit.lib.PersonIdent personIdent) |
protected Void |
doRevert(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String objectId,
String blobPath,
String commitMessage,
org.eclipse.jgit.lib.PersonIdent personIdent) |
protected CommitInfo |
doWrite(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String path,
byte[] contents,
org.eclipse.jgit.lib.PersonIdent personIdent,
String commitMessage) |
protected <T> T |
doWriteFile(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty,
WriteCallback callback)
Performs a write operation on the file
|
protected org.eclipse.jgit.lib.ObjectId |
getBranchObjectId(org.eclipse.jgit.api.Git git,
String branch) |
protected String |
getDefaultObjectName() |
protected File |
getFile(File rootDir,
String path)
Returns the file for the given path relative to the git root directory
|
protected static String |
getFilePattern(String path) |
String |
getRepositoryLabel() |
protected String |
getShortCommitHash(String name) |
protected boolean |
isIgnoreFile(File child) |
protected abstract boolean |
isPushOnCommit() |
protected String |
removeLeadingSlash(String path) |
void |
setRepositoryLabel(String repositoryLabel) |
protected String |
toString(Collection<org.eclipse.jgit.transport.RemoteRefUpdate> updates) |
destroy, getMBeanServer, getObjectName, init, setMBeanServer, setObjectNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbranches, completePath, createBranch, createDirectory, diff, exists, getCommitInfo, getCommitTree, getContent, getHEAD, history, read, readJsonChildContent, remove, rename, revertTo, uploadFile, write, writeBase64readFile, writeFilepublic void setRepositoryLabel(String repositoryLabel)
public String getRepositoryLabel()
getRepositoryLabel in interface GitFacadeMXBeanprotected String doDiff(org.eclipse.jgit.api.Git git, String objectId, String baseObjectId, String pathOrBlobPath)
protected abstract void checkoutBranch(org.eclipse.jgit.api.Git git,
String branch)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected abstract boolean isPushOnCommit()
protected void doCreateBranch(org.eclipse.jgit.api.Git git,
String fromBranch,
String newBranch)
throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected List<CommitTreeInfo> doGetCommitTree(org.eclipse.jgit.api.Git git, String commitId)
protected CommitInfo doGetCommitInfo(org.eclipse.jgit.api.Git git, String commitId)
protected abstract Iterable<org.eclipse.jgit.transport.PushResult> doPush(org.eclipse.jgit.api.Git git) throws Exception
Exceptionprotected CommitInfo doCreateDirectory(org.eclipse.jgit.api.Git git, File rootDir, String branch, String path, org.eclipse.jgit.lib.PersonIdent personIdent, String commitMessage) throws Exception
Exceptionprotected Void doRevert(org.eclipse.jgit.api.Git git, File rootDir, String branch, String objectId, String blobPath, String commitMessage, org.eclipse.jgit.lib.PersonIdent personIdent) throws Exception
Exceptionprotected org.eclipse.jgit.revwalk.RevCommit doRename(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String oldPath,
String newPath,
String commitMessage,
org.eclipse.jgit.lib.PersonIdent personIdent)
throws Exception
Exceptionprotected org.eclipse.jgit.revwalk.RevCommit doRemove(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String path,
String commitMessage,
org.eclipse.jgit.lib.PersonIdent personIdent)
throws Exception
Exceptionprotected List<String> doListBranches(org.eclipse.jgit.api.Git git) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected String doGetHead(org.eclipse.jgit.api.Git git)
protected List<CommitInfo> doHistory(org.eclipse.jgit.api.Git git, String branch, String objectId, String pathOrBlobPath, int limit)
protected org.eclipse.jgit.lib.ObjectId getBranchObjectId(org.eclipse.jgit.api.Git git,
String branch)
protected String getDefaultObjectName()
getDefaultObjectName in class MBeanSupportprotected String doGetContent(org.eclipse.jgit.api.Git git, String objectId, String pathOrBlobPath)
protected FileContents doRead(org.eclipse.jgit.api.Git git, File rootDir, String branch, String pathOrEmpty) throws IOException, org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionprotected <T> T doReadFile(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty,
Function<File,T> callback)
throws IOException,
org.eclipse.jgit.api.errors.GitAPIException
IOExceptionorg.eclipse.jgit.api.errors.GitAPIExceptionprotected <T> T doWriteFile(org.eclipse.jgit.api.Git git,
File rootDir,
String branch,
String pathOrEmpty,
WriteCallback callback)
throws Exception
Exceptionprotected FileInfo doExists(org.eclipse.jgit.api.Git git, File rootDir, String branch, String pathOrEmpty) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected FileInfo doExists(org.eclipse.jgit.api.Git git, File rootDir, String branch, String pathOrEmpty, boolean caseSensitive) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected List<String> doCompletePath(org.eclipse.jgit.api.Git git, File rootDir, String branch, String completionText, boolean directoriesOnly) throws org.eclipse.jgit.api.errors.GitAPIException
org.eclipse.jgit.api.errors.GitAPIExceptionprotected String doReadJsonChildContent(org.eclipse.jgit.api.Git git, File rootDir, String branch, String path, String fileNameWildcard, String search) throws org.eclipse.jgit.api.errors.GitAPIException, IOException
org.eclipse.jgit.api.errors.GitAPIExceptionIOExceptionprotected CommitInfo doWrite(org.eclipse.jgit.api.Git git, File rootDir, String branch, String path, byte[] contents, org.eclipse.jgit.lib.PersonIdent personIdent, String commitMessage) throws Exception
Exceptionprotected org.eclipse.jgit.revwalk.RevCommit commitThenPush(org.eclipse.jgit.api.Git git,
String branch,
org.eclipse.jgit.api.CommitCommand commit)
throws Exception
Exceptionprotected String toString(Collection<org.eclipse.jgit.transport.RemoteRefUpdate> updates)
public CommitInfo createCommitInfo(org.eclipse.jgit.revwalk.RevCommit entry)
protected boolean isIgnoreFile(File child)
Copyright © 2019 JBoss by Red Hat. All rights reserved.