Class MalwareScanReport

java.lang.Object
de.xima.fc.security.malware.MalwareScanReport
All Implemented Interfaces:
Serializable

public final class MalwareScanReport extends Object implements Serializable
Represents the result of a malware scan.
Since:
7.0.13
Author:
XIMA MEDIA GmbH
See Also:
  • Constructor Details

    • MalwareScanReport

      public MalwareScanReport(EMalwareScanOutcome outcome, String detailedScanReport, Throwable error)
      Creates a new malware scan report with the given data.
      Parameters:
      outcome - The type of the malware scan result, see getOutcome().
      detailedScanReport - Detailed scan report or message, see getDetailedScanReport().
      error - Error that occurred during scanning, if any. See also getError().
  • Method Details

    • getDetailedScanReport

      public String getDetailedScanReport()
      Returns:
      A detailed report of the malware scan, such as the command line output or log messages of the malware scanner.
    • getError

      public Optional<Throwable> getError()
      Returns:
      The error that occurred during the malware scan, if any. An error is usually present when the outcome is SCAN_FAILURE.
    • getOutcome

      public EMalwareScanOutcome getOutcome()
      Returns:
      The outcome
    • isSafe

      public boolean isSafe()
      Returns false if the file or data might be malware infected and should be considered unsafe. This may happen either when a malware scanner found a malware signature, or when the malware scan failed due to an unhandled error. Returns true when the file or data was scanned successfully and no malware could be detected despite best efforts. true is also returned when no malware scanner is available on the system.
      Returns:
      true if the file or data is safe and no malware was found, false otherwise.
    • isUnsafe

      public boolean isUnsafe()
      Returns true if the file or data might be malware infected and must be considered unsafe. Unsafe data must not be processed any further and should be discarded. This may happen either when a malware scanner found a malware signature, or when the malware scan failed due to an unhandled error. Returns false when the file or data was scanned successfully and no malware could be detected despite best efforts. false is also returned when no malware scanner is available on the system.
      Returns:
      true if the file or data is unsafe and may contain malware, false otherwise.