Service for checking if the application version is up to date by querying the GitHub API. More...
Public Member Functions | |
| VersionService (HttpClient httpClient, ObjectMapper objectMapper, SpinnerService spinnerService) | |
| Constructs a new VersionService with required infrastructure services. | |
| Task< Boolean > | checkLatestVersion () |
| Checks if the current application version matches the latest release on GitHub. | |
Static Public Attributes | |
| static final int | MAX_TAG_NAME_LENGTH = 256 |
| static final int | MAX_TAGS_RESPONSE_SIZE = 65_536 |
Private Member Functions | |
| boolean | parseResponse (byte[] data) |
| Parses the byte array directly. | |
Private Attributes | |
| final HttpClient | httpClient |
| final ObjectMapper | objectMapper |
| final SpinnerService | spinnerService |
Static Private Attributes | |
| static final String | CURRENT_VERSION |
| static final int | HTTP_STATUS_OK = 200 |
| static final Logger | LOG = LoggerFactory.getLogger(VersionService.class) |
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.sudokufx.service.external.VersionService.VersionService | ( | HttpClient | httpClient, |
| ObjectMapper | objectMapper, | ||
| SpinnerService | spinnerService ) |
Constructs a new VersionService with required infrastructure services.
| httpClient | the HttpClient used for API requests |
| objectMapper | the ObjectMapper for JSON deserialization |
| spinnerService | the SpinnerService for UI loading feedback |
| Task< Boolean > fr.softsf.sudokufx.service.external.VersionService.checkLatestVersion | ( | ) |
Checks if the current application version matches the latest release on GitHub.
Task returning true if up-to-date, false if update available
|
private |
Parses the byte array directly.
| data | the byte array containing the JSON response, limited by MAX_TAGS_RESPONSE_SIZE |
true if versions match or if parsing fails; false if a different version is detected
|
staticprivate |
|
staticprivate |
|
private |
|
staticprivate |
|
static |
|
static |
|
private |
|
private |