Class ResolutionRequest
java.lang.Object
io.github.intisy.gradle.github.api.model.ResolutionRequest
A single coordinate to resolve to a jar, naming a release version, a GitHub source branch and
commit, an arbitrary git clone URL and ref, or a direct jar URL. Callers construct one via
fromRelease(String, String, String), fromSource(String, String, String, String),
fromGit(String, String), or fromUrl(String, Map, String) and pass it to
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest).-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhich capability aResolutionRequestis satisfied by. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResolutionRequeststatic ResolutionRequestfromRelease(String owner, String repo, String version) static ResolutionRequestfromSource(String owner, String repo, String branch, String commitSha) static ResolutionRequestSame asfromUrl(String, Map, String)with no expected sha256.static ResolutionRequestgetOwner()getRef()getRepo()
-
Method Details
-
fromRelease
- Parameters:
owner- the GitHub account or organization that owns the repository.repo- the repository name, without the owner prefix.version- the release tag to resolve.- Returns:
- a request that
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest)satisfies from a published release. - Throws:
IllegalArgumentException- if any argument is null.
-
fromSource
public static ResolutionRequest fromSource(String owner, String repo, String branch, String commitSha) - Parameters:
owner- the GitHub account or organization that owns the repository.repo- the repository name, without the owner prefix.branch- the branch to clone or pull.commitSha- the commit to build, or null to use the branch's latest commit.- Returns:
- a request that
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest)satisfies by building from source. - Throws:
IllegalArgumentException- ifowner,repo, orbranchis null.
-
fromGit
- Parameters:
cloneUrl- the exact URL to clone from; any git host, not just github.com.ref- the branch, tag, or commit to build, or null for the remote's default branch.- Returns:
- a request that
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest)satisfies by cloning and buildingcloneUrl. - Throws:
IllegalArgumentException- ifcloneUrlis null.
-
fromUrl
Same asfromUrl(String, Map, String)with no expected sha256.- Parameters:
jarUrl- the exact URL to download a jar from.headers- request headers (for example, an auth token) to send with the download; may be null or empty.- Returns:
- a request that
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest)satisfies by downloadingjarUrl. - Throws:
IllegalArgumentException- ifjarUrlis null.
-
fromUrl
- Parameters:
jarUrl- the exact URL to download a jar from.headers- request headers (for example, an auth token) to send with the download; may be null or empty.sha256- the expected SHA-256 of the downloaded jar, hex-encoded, or null to skip integrity verification.- Returns:
- a request that
JarResolver.resolve(io.github.intisy.gradle.github.api.model.ResolutionRequest)satisfies by downloadingjarUrl. - Throws:
IllegalArgumentException- ifjarUrlis null.
-
getOwner
- Returns:
- the GitHub account or organization that owns the requested repository, or null for
a
ResolutionRequest.Strategy.GITorResolutionRequest.Strategy.URLrequest.
-
getRepo
- Returns:
- the requested repository name, without the owner prefix, or null for a
ResolutionRequest.Strategy.GITorResolutionRequest.Strategy.URLrequest.
-
getStrategy
- Returns:
- which capability this request is satisfied by.
-
getVersion
- Returns:
- the release tag to resolve, or null unless this is a
ResolutionRequest.Strategy.RELEASErequest.
-
getBranch
- Returns:
- the branch to clone or pull, or null unless this is a
ResolutionRequest.Strategy.SOURCErequest.
-
getCommitSha
- Returns:
- the commit to build, or null unless this is a
ResolutionRequest.Strategy.SOURCErequest naming one.
-
getCloneUrl
- Returns:
- the exact URL to clone from, or null unless this is a
ResolutionRequest.Strategy.GITrequest.
-
getRef
- Returns:
- the branch, tag, or commit to build, or null unless this is a
ResolutionRequest.Strategy.GITrequest.
-
getJarUrl
- Returns:
- the exact URL to download a jar from, or null unless this is a
ResolutionRequest.Strategy.URLrequest.
-
getHeaders
- Returns:
- the request headers to send with a
ResolutionRequest.Strategy.URLdownload; never null, empty when none were given or this is not aResolutionRequest.Strategy.URLrequest.
-
getSha256
- Returns:
- the expected SHA-256 of the downloaded jar, hex-encoded, or null if none was given
or this is not a
ResolutionRequest.Strategy.URLrequest.
-