public class GitLabUtils extends Object
Utility methods for the gitlab repository.
| Constructor and Description |
|---|
GitLabUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkIsInRepo(URL url,
URL repoUrl)
If the url is not in the repoURL a NotFoundException is thrown.
|
static String[] |
getProjectIdAndLastFieldFromURL(URL url)
Return the projectId and the last path part in a two sized array.
|
static String |
getProjectIdFromURL(URL url)
Return the project id from a gitlab repo URL.
|
static org.jboss.set.aphrodite.domain.CommitStatus |
toCommitStatus(String statusValue)
Converts a gitlan commit status into an aphrodite commit status.
|
static org.jboss.set.aphrodite.domain.Label |
toLabel(org.gitlab4j.api.models.Label l,
URL repoUrl)
Converts a gitlab label into an aphrodite one.
|
static boolean |
toMergeable(String mergeStatus)
Returns if the merge status is a mergeable aphrodite status.
|
static org.jboss.set.aphrodite.domain.PullRequest |
toPullRequest(org.gitlab4j.api.models.MergeRequest m,
List<org.gitlab4j.api.models.Commit> commits,
URL url,
org.jboss.set.aphrodite.domain.Repository repo,
org.jboss.set.aphrodite.domain.spi.PullRequestHome prHome)
Converts a gitlab merge object into an aphrodite pull request.
|
static org.jboss.set.aphrodite.domain.PullRequestState |
toPullRequestState(String state)
Converts gitlab state into a PullRequestState
|
static boolean |
urlIsInRepo(URL url,
URL repoUrl)
Method to check if an URL is in the repo URL.
|
public static String getProjectIdFromURL(URL url)
url - The gitab repo URLpublic static String[] getProjectIdAndLastFieldFromURL(URL url)
url - The URL to parsepublic static boolean urlIsInRepo(URL url, URL repoUrl)
url - The URL to checkrepoUrl - The repository URLpublic static void checkIsInRepo(URL url, URL repoUrl) throws NotFoundException
url - The URL to checkrepoUrl - The repository URLNotFoundException - If url is not in repoUrlpublic static org.jboss.set.aphrodite.domain.PullRequestState toPullRequestState(String state)
state - The gitlab statepublic static boolean toMergeable(String mergeStatus)
mergeStatus - The gitlab merge statuspublic static org.jboss.set.aphrodite.domain.CommitStatus toCommitStatus(String statusValue)
statusValue - The gitlab status of the commitpublic static org.jboss.set.aphrodite.domain.PullRequest toPullRequest(org.gitlab4j.api.models.MergeRequest m, List<org.gitlab4j.api.models.Commit> commits, URL url, org.jboss.set.aphrodite.domain.Repository repo, org.jboss.set.aphrodite.domain.spi.PullRequestHome prHome)
m - The gilab merge objectcommits - The commits of the merge requesturl - The URL for the mergerepo - The repository of the mergeprHome - The pull request home to use in the orpublic static org.jboss.set.aphrodite.domain.Label toLabel(org.gitlab4j.api.models.Label l, URL repoUrl)
l - The gitlab labelrepoUrl - The label URLCopyright © 2020 JBoss by Red Hat. All rights reserved.