Class ClammitVirusScanner

java.lang.Object
formflow.library.file.ClammitVirusScanner
All Implemented Interfaces:
FileVirusScanner

@Service @ConditionalOnProperty(name="form-flow.uploads.virus-scanning.enabled", havingValue="true") public class ClammitVirusScanner extends Object implements FileVirusScanner
Clammit Virus Scanner An implementation of the FileVirusScanner interface that will use the Clammit Virus Scanner Server to check files for viruses.

The Clammit Virus Scanner Server itself is set up independently of this code base.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ClammitVirusScanner(String clammitUrl, int timeout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    virusDetected(org.springframework.web.multipart.MultipartFile file)
    This method will send the passed in `file` to a virus scanner service defined in the implementation and return a boolean value indicating if the file contains a virus.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClammitVirusScanner

      public ClammitVirusScanner(@Value("${form-flow.uploads.virus-scanning.service-url}") String clammitUrl, @Value("${form-flow.uploads.virus-scanning.timeout:5000}") int timeout)
  • Method Details

    • virusDetected

      public boolean virusDetected(org.springframework.web.multipart.MultipartFile file) throws Exception
      Description copied from interface: FileVirusScanner
      This method will send the passed in `file` to a virus scanner service defined in the implementation and return a boolean value indicating if the file contains a virus.
      Specified by:
      virusDetected in interface FileVirusScanner
      Parameters:
      file - file to check for virus in
      Returns:
      true if virus is found, false otherwise
      Throws:
      Exception