Service for checking if the application version is up to date by querying the GitHub API. More...
Public Member Functions | |
| VersionService () | |
| Enum constructor initializing the infrastructure. | |
| SwingWorker< VersionValue, Void > | checkLatestVersion (String currentVersion, JButton updateButton) |
| Checks if the current application version matches the latest release on GitHub. | |
Public Attributes | |
| INSTANCE | |
Static Public Attributes | |
| static final int | HTTP_FORBIDDEN = 403 |
| static final int | HTTP_NOT_FOUND = 404 |
Private Member Functions | |
| VersionValue | parseResponse (byte[] data, String cleanCurrentVersion) |
| Parses the byte array directly. | |
| void | updateButtonState (JButton button, boolean enabled, String tooltip) |
| Updates the UI button state. | |
Private Attributes | |
| final HttpClient | httpClient |
| final ObjectMapper | objectMapper |
Static Private Attributes | |
| static final String | CLOSE_HTML = "</html>" |
| static final String | GITHUB_TAGS_API_URL |
| static final int | HTTP_STATUS_OK = 200 |
| static final String | LATEST_RELEASES_REPO_URL |
| static final int | MAX_TAG_NAME_LENGTH = 256 |
| static final int | MAX_TAGS_RESPONSE_SIZE = 65_536 |
| static final String | OPEN_HTML = "<html>" |
| static final String | TOOLTIP_PREFIX = "Mise à jour :<br>" |
Service for checking if the application version is up to date by querying the GitHub API.
It retrieves the latest release tag from the repository and compares it with the current application version.
| fr.softsf.canscan.service.VersionService.VersionService | ( | ) |
Enum constructor initializing the infrastructure.
| SwingWorker< VersionValue, Void > fr.softsf.canscan.service.VersionService.checkLatestVersion | ( | String | currentVersion, |
| JButton | updateButton ) |
Checks if the current application version matches the latest release on GitHub.
| currentVersion | Current application version |
| updateButton | Target button for state updates |
SwingWorker returning a VersionValue
|
private |
Parses the byte array directly.
| data | the byte array containing the JSON response |
| cleanCurrentVersion | the current version without prefix |
VersionValue
|
private |
Updates the UI button state.
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
staticprivate |
|
private |
| fr.softsf.canscan.service.VersionService.INSTANCE |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |