Skip to content

Commit

Permalink
Fix for WindowsUpdater
Browse files Browse the repository at this point in the history
  • Loading branch information
benchdoos committed Oct 15, 2023
1 parent baaf623 commit 1b433af
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@
import com.github.benchdoos.weblocopenercore.client.impl.DefaultGitHubClient;
import com.github.benchdoos.weblocopenercore.domain.version.AppVersion;
import com.github.benchdoos.weblocopenercore.exceptions.NoAvailableVersionException;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.atomic.AtomicReference;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.collections.CollectionUtils;

@Log4j2
public class WindowsUpdater implements Updater {
Expand Down Expand Up @@ -111,10 +112,7 @@ public AppVersion.Asset getInstallerAsset(final AppVersion appVersion)

if (CollectionUtils.isNotEmpty(appVersion.assets())) {
return appVersion.assets().stream()
.filter(
a ->
a.contentType().equals("application/octet-stream")
&& a.name().matches(WINDOWS_FILE_REGEX))
.filter(a -> a.name().matches(WINDOWS_FILE_REGEX))
.findFirst()
.orElseThrow(() -> new NoAvailableVersionException("Needed installer file not found"));
}
Expand Down

0 comments on commit 1b433af

Please sign in to comment.