Skip to content

Commit

Permalink
devonfw#103: moved urlSecurityJson to its own class
Browse files Browse the repository at this point in the history
  • Loading branch information
MattesMrzik committed Dec 22, 2023
1 parent 9a86e34 commit fe9109f
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 238 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;

import com.devonfw.tools.ide.url.model.file.json.UrlSecurityWarning;
import com.devonfw.tools.ide.cli.CliException;
import com.devonfw.tools.ide.commandlet.Commandlet;
import com.devonfw.tools.ide.common.Tags;
Expand All @@ -22,7 +23,6 @@
import com.devonfw.tools.ide.process.ProcessErrorHandling;
import com.devonfw.tools.ide.property.StringListProperty;
import com.devonfw.tools.ide.url.model.file.UrlSecurityJsonFile;
import com.devonfw.tools.ide.url.model.file.UrlSecurityJsonFile.UrlSecurityWarning;
import com.devonfw.tools.ide.util.FilenameUtil;
import com.devonfw.tools.ide.version.VersionIdentifier;

Expand Down Expand Up @@ -188,7 +188,7 @@ protected VersionIdentifier securityRiskInteraction(VersionIdentifier configured

VersionIdentifier current = this.context.getUrls().getVersion(this.tool, this.getEdition(), configuredVersion);

if (!securityFile.contains(current, true, this.context)) {
if (!securityFile.contains(current, true, this.context, securityFile.getParent())) {
return configuredVersion;
}

Expand All @@ -198,14 +198,14 @@ protected VersionIdentifier securityRiskInteraction(VersionIdentifier configured
int currentVersionIndex = allVersions.indexOf(current);
VersionIdentifier nextSafe = null;
for (int i = currentVersionIndex - 1; i >= 0; i--) {
if (!securityFile.contains(allVersions.get(i), true, this.context)) {
if (!securityFile.contains(allVersions.get(i), true, this.context, securityFile.getParent())) {
nextSafe = allVersions.get(i);
break;
}
}
VersionIdentifier latestSafe = null;
for (int i = 0; i < allVersions.size(); i++) {
if (!securityFile.contains(allVersions.get(i), true, this.context)) {
if (!securityFile.contains(allVersions.get(i), true, this.context, securityFile.getParent())) {
latestSafe = allVersions.get(i);
break;
}
Expand Down
Loading

0 comments on commit fe9109f

Please sign in to comment.