SUPPORT-8841: add scan result logs

This commit is contained in:
Alexandr Shalaginov 2025-01-11 11:35:50 +03:00
parent c22fa63d15
commit f8482124ba

View file

@ -66,6 +66,7 @@ public class FileScanService {
try (InputStream inputStream = process.getInputStream()) {
String result = new String(inputStream.readAllBytes());
LOGGER.info("File {} scanned with result: {}", originalFileName, result);
int exitCode = process.waitFor();
if (exitCode != 0 && exitCode != 72) {
@ -79,6 +80,12 @@ public class FileScanService {
}
private void checkScanResult(String result, String originalFileName) {
if (!result.contains(passwordProtectedResultName)) {
LOGGER.warn("File scan result doesn't contains \"{}\", "
+ "please check property \"password.protected.result.name\" is correct",
passwordProtectedResultName);
}
for (String line : result.split("\n")) {
String[] lineParts = line.split(":");
if (lineParts.length > 1) {