SUPPORT-9157: fix

This commit is contained in:
Alexandr Shalaginov 2025-05-05 16:06:20 +03:00
parent a0eaa3ed59
commit ca1b116c08

View file

@ -87,12 +87,12 @@ public class FileScanService {
}
private void checkScanResult(String result, String originalFileName) {
boolean isResultContains = passwordProtectedResultNamesProperty.getNames().stream()
boolean isResultNotContains = passwordProtectedResultNamesProperty.getNames().stream()
.filter(result::contains)
.toList()
.isEmpty();
if (!isResultContains) {
if (isResultNotContains) {
throw new AvException(String.format(
"File scan result doesn't contains any of values: \"%s\". "
+ "Please check property \"password.protected.result.names\" is correct",
@ -103,7 +103,7 @@ public class FileScanService {
for (String line : result.split("\n")) {
String[] lineParts = line.split(":");
if (lineParts.length > 1) {
boolean isLinePartStartWith = passwordProtectedResultNamesProperty.getNames().stream()
boolean isLinePartStartWith = !passwordProtectedResultNamesProperty.getNames().stream()
.filter(lineParts[0]::startsWith)
.toList()
.isEmpty();