Skip to content

Commit 7214218

Browse files
committed
Use @DistributionChannel
1 parent f6fb64f commit 7214218

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/main/java/org/cryptomator/linux/update/FlatpakUpdater.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.cryptomator.linux.update;
22

33
import org.cryptomator.integrations.common.CheckAvailability;
4+
import org.cryptomator.integrations.common.DistributionChannel;
45
import org.cryptomator.integrations.common.OperatingSystem;
56
import org.cryptomator.integrations.common.Priority;
67
import org.cryptomator.integrations.update.UpdateFailedException;
@@ -24,6 +25,7 @@
2425

2526
@Priority(1000)
2627
@CheckAvailability
28+
@DistributionChannel(DistributionChannel.Value.LINUX_FLATPAK)
2729
@OperatingSystem(OperatingSystem.Value.LINUX)
2830
public class FlatpakUpdater implements UpdateService, AutoCloseable {
2931

@@ -44,9 +46,10 @@ public boolean isSupported() {
4446
}
4547

4648
@Override
47-
public String isUpdateAvailable(DistributionChannel channel) {
48-
if (channel != DistributionChannel.LINUX_FLATPAK) {
49-
return "";
49+
public String isUpdateAvailable(DistributionChannel.Value channel) {
50+
if (channel != DistributionChannel.Value.LINUX_FLATPAK) {
51+
LOG.error("Wrong channel provided: {}", channel);
52+
return null;
5053
}
5154
try (ExecutorService executor = Executors.newFixedThreadPool(10)) {
5255
var task = new UpdateCheckerTask(APP_NAME);
@@ -57,7 +60,7 @@ public String isUpdateAvailable(DistributionChannel channel) {
5760
LOG.error(e.toString(), e.getCause());
5861
}
5962
}
60-
return "";
63+
return null;
6164
}
6265

6366
@Override

0 commit comments

Comments
 (0)