SUPPORT-9157: fix
This commit is contained in:
parent
a0eaa3ed59
commit
ca1b116c08
1 changed files with 3 additions and 3 deletions
|
|
@ -87,12 +87,12 @@ public class FileScanService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkScanResult(String result, String originalFileName) {
|
private void checkScanResult(String result, String originalFileName) {
|
||||||
boolean isResultContains = passwordProtectedResultNamesProperty.getNames().stream()
|
boolean isResultNotContains = passwordProtectedResultNamesProperty.getNames().stream()
|
||||||
.filter(result::contains)
|
.filter(result::contains)
|
||||||
.toList()
|
.toList()
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
|
|
||||||
if (!isResultContains) {
|
if (isResultNotContains) {
|
||||||
throw new AvException(String.format(
|
throw new AvException(String.format(
|
||||||
"File scan result doesn't contains any of values: \"%s\". "
|
"File scan result doesn't contains any of values: \"%s\". "
|
||||||
+ "Please check property \"password.protected.result.names\" is correct",
|
+ "Please check property \"password.protected.result.names\" is correct",
|
||||||
|
|
@ -103,7 +103,7 @@ public class FileScanService {
|
||||||
for (String line : result.split("\n")) {
|
for (String line : result.split("\n")) {
|
||||||
String[] lineParts = line.split(":");
|
String[] lineParts = line.split(":");
|
||||||
if (lineParts.length > 1) {
|
if (lineParts.length > 1) {
|
||||||
boolean isLinePartStartWith = passwordProtectedResultNamesProperty.getNames().stream()
|
boolean isLinePartStartWith = !passwordProtectedResultNamesProperty.getNames().stream()
|
||||||
.filter(lineParts[0]::startsWith)
|
.filter(lineParts[0]::startsWith)
|
||||||
.toList()
|
.toList()
|
||||||
.isEmpty();
|
.isEmpty();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue