SUPPORT-8841: add scan result logs
This commit is contained in:
parent
c22fa63d15
commit
f8482124ba
1 changed files with 7 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue