public class GitHubChecker extends VersionChecker
| Constructor and Description |
|---|
GitHubChecker(@NotNull java.lang.String gitHubUserRepository)
Constructs a GitHub checker with the given
user/repository combination to allow for version checks as
well as version and URL acquisition. |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.lang.String> |
allVersions()
Gather a list of all available versions for the given repository.
|
java.util.List<java.lang.String> |
getAssetsDownloadUrls(@NotNull java.lang.String requestedVersion)
Get the asset download URLs for a particular tag/version.
|
java.lang.String |
getDownloadUrl(@NotNull java.lang.String version)
Get the URL for the given release version.
|
java.lang.String |
latestVersion(boolean checkForPreRelease)
Get the latest regular release.
|
GitHubChecker |
refresh()
Refresh this GitHub-instance.
|
protected void |
setRepository()
Acquire this instances repository information and store it in a
JsonNode for later use. |
checkForUpdate, getAllVersions, getObjectMapper, getResponse, latestAlpha, latestBeta, setAllVersionspublic GitHubChecker(@NotNull
@NotNull java.lang.String gitHubUserRepository)
throws java.net.MalformedURLException
user/repository combination to allow for version checks as
well as version and URL acquisition.gitHubUserRepository - String. GitHub user/repository-combination. For example Griefed/ServerPackCreatorjava.net.MalformedURLException - Thrown if the resulting URL is malformed or otherwise invalid.public GitHubChecker refresh() throws java.io.IOException
refresh in class VersionCheckerjava.io.IOException - Exception thrown if setRepository() or setLatest() encounter an error.public java.util.List<java.lang.String> allVersions()
allVersions in class VersionCheckernull is returned.public java.lang.String latestVersion(boolean checkForPreRelease)
latestVersion in class VersionCheckercheckForPreRelease - Boolean. Whether to include alpha and beta releases for latest release versions.no_release is returned.public java.lang.String getDownloadUrl(@NotNull
@NotNull java.lang.String version)
getDownloadUrl in class VersionCheckerversion - String. The version for which to get the URL to.protected void setRepository()
throws java.io.IOException
JsonNode for later use.setRepository in class VersionCheckerjava.io.IOException - Thrown if the repository can not be reached or any other unexpected error occurs.public java.util.List<java.lang.String> getAssetsDownloadUrls(@NotNull
@NotNull java.lang.String requestedVersion)
getAssetsDownloadUrls in class VersionCheckerrequestedVersion - String. The version you want to retrieve the asset download URLs for.