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. |
GitHubChecker(@NotNull java.lang.String user,
@NotNull java.lang.String repository)
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.Optional<Update> |
check(@NotNull java.lang.String currentVersion,
boolean checkForPreReleases)
Check whether an update/newer version is available for the given version.
|
java.util.List<java.lang.String> |
getAssetsDownloadUrls(@NotNull java.lang.String requestedVersion)
Deprecated.
The aim of VersionChecker is not to browse a given repository, but to check for availability of updates,
and if an update is available, work from there. See
check(String, boolean) which returns an instance of
Update. This provides everything you need. |
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, or pre-release if
checkForPreRelease is true. |
GitHubChecker |
refresh()
Refresh this GitHub-instance.
|
protected void |
setRepository()
Acquire this instances repository information and store it in a
JsonNode for later use. |
checkForUpdate, compareSemantics, getAllVersions, getObjectMapper, getResponse, isUpdateAvailable, 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(@NotNull
@NotNull java.lang.String user,
@NotNull
@NotNull java.lang.String repository)
throws java.net.MalformedURLException
user/repository combination to allow for version checks as
well as version and URL acquisition.user - String GitHub user and owner of the repository.repository - String GitHub repository owned by the aforementioned user.java.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.Optional<Update> check(@NotNull @NotNull java.lang.String currentVersion, boolean checkForPreReleases)
true for checkForPreReleases.check in class VersionCheckercurrentVersion - String. The current version of the app.checkForPreReleases - Boolean. false if you do not want to check for PreReleases. true
if you want to check for PreReleases as well.Update-instance, wrapped in an Optional, contianing information about the available update.public java.util.List<java.lang.String> allVersions()
allVersions in class VersionCheckernull is returned.public java.lang.String latestVersion(boolean checkForPreRelease)
checkForPreRelease is true.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.@Deprecated
public java.util.List<java.lang.String> getAssetsDownloadUrls(@NotNull
@NotNull java.lang.String requestedVersion)
check(String, boolean) which returns an instance of
Update. This provides everything you need.getAssetsDownloadUrls in class VersionCheckerrequestedVersion - String. The version you want to retrieve the asset download URLs for.