Interface IMalwareScanner

  • All Known Implementing Classes:
    EicarVirusTestFileScanner

    public interface IMalwareScanner
    Interface for a scanner that can detect malware. A malware scanner scans a file or some piece of data for malicious code and reports the result. The scanner could either perform the scan in any number of ways, including scanning via a native Java implementation, initiating a REST API call, delegating to another library or even running a command line program.
    Since:
    7.0.13
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • scan

        IMalwareScanResult scan​(Path file)
                         throws Exception
        Scans an existing file on the file system for malware. Implementations should scan the file, but leave the file untouched. If it cannot be avoided, it is permissible for implementations to delete the file when malware was detected, but discouraged. It is up to the caller of this method to decide what should be done with the file.
        Parameters:
        file - A file on the file system to scan for malware. This path must be an absolute path.
        Returns:
        The result of the scan.
        Throws:
        Exception - When the scan could not be performed. Be careful however, when an exception is thrown, the file is assumed to contain malware!