diff --git a/src/main/java/eu/m724/jarupdater/Updater.java b/src/main/java/eu/m724/jarupdater/Updater.java index be07850..8b91e32 100644 --- a/src/main/java/eu/m724/jarupdater/Updater.java +++ b/src/main/java/eu/m724/jarupdater/Updater.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.NoSuchFileException; import java.security.SignatureException; +import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; @@ -28,10 +29,17 @@ public class Updater { public Environment getEnvironment() { return environment; } + + /** + * Get all channels + * @return A future which returns the list of all channels + */ + public CompletableFuture> getChannels() { return metadataProvider.getChannels(); } + /** - * get the latest available version - * @return a future which can throw ioexpception + * Get the latest available version + * @return A future which returns latest version metadata */ public CompletableFuture getLatestVersion() { CompletableFuture currentVersionFuture = metadataProvider.getCurrentVersionMetadata(); @@ -49,16 +57,16 @@ public class Updater { } /** - * get information about this version - * @return a future which can throw ioexpception + * Get information about this version + * @return A future which returns current version metadata */ public CompletableFuture getCurrentVersion() { return metadataProvider.getCurrentVersionMetadata(); } /** - * download the latest available version - * @return a future which returns the downloaded file, it can also throw ioexpception or signatureexception + * Download the latest available version + * @return a future which returns the downloaded file */ public CompletableFuture downloadLatestVersion() { CompletableFuture latestVersionFuture = metadataProvider.getLatestVersionMetadata(); @@ -75,9 +83,9 @@ public class Updater { } /** - * installs the ALREADY DOWNLOADED latest version - * you can call it immediately after {@link #downloadLatestVersion()} - * @return a {@link CompletableFuture} that ends after move. it can throw + * Installs the ALREADY DOWNLOADED latest version
+ * You can call it immediately after {@link #downloadLatestVersion()} + * @return a {@link CompletableFuture} that ends after move, it can throw some exceptions. * @throws NoSuchFileException if you didn't download it first */ public CompletableFuture installLatestVersion() throws NoSuchFileException { diff --git a/src/main/java/eu/m724/jarupdater/live/GiteaMetadataDAO.java b/src/main/java/eu/m724/jarupdater/live/GiteaMetadataDAO.java index 8483fc6..65328ef 100644 --- a/src/main/java/eu/m724/jarupdater/live/GiteaMetadataDAO.java +++ b/src/main/java/eu/m724/jarupdater/live/GiteaMetadataDAO.java @@ -43,7 +43,7 @@ public class GiteaMetadataDAO implements MetadataDAO { @Override public CompletableFuture getMetadata(String channel, String versionLabel) { - String url = getFileUrl(versionLabel, "meta-v1.json"); + String url = getFileUrl(channel, versionLabel, "meta-v1.json"); CompletableFuture metadataFuture = makeRequest(url).thenApply(response -> {