Class ClamavVirusScannerImpl

java.lang.Object
org.craftercms.virusscanner.impl.ClamavVirusScannerImpl
All Implemented Interfaces:
VirusScanner

public class ClamavVirusScannerImpl extends Object implements VirusScanner
A virus scanner that uses ClamScan to scan input-streams/files
  • Field Details

  • Constructor Details

    • ClamavVirusScannerImpl

      public ClamavVirusScannerImpl()
    • ClamavVirusScannerImpl

      public ClamavVirusScannerImpl(String host, int port, int timeout)
      Parameters:
      host - the clamd server host
      port - the clamd server port
      timeout - milliseconds to wait for the connection
  • Method Details

    • scan

      public void scan(String filename)
      Scans the file for virus.
      Specified by:
      scan in interface VirusScanner
      Parameters:
      filename - full path
    • scan

      public void scan(InputStream inputStream)
      Scans the InputStream for viruses.
      Specified by:
      scan in interface VirusScanner
      Parameters:
      inputStream -
    • setHost

      public void setHost(String host)
      Parameters:
      host - the clamd server host
    • setPort

      public void setPort(int port)
      Parameters:
      port - the clamd server port
    • setTimeout

      public void setTimeout(int timeout)
      Parameters:
      timeout - milliseconds to wait for the connection
    • getHost

      public String getHost()
      Returns:
      the clamd server host
    • getPort

      public int getPort()
      Returns:
      the clamd server port
    • getTimeout

      public int getTimeout()
      Returns:
      the milliseconds to wait for the connection