Package clamavj

Class ClamScan

java.lang.Object
clamavj.ClamScan

public class ClamScan extends Object
  • Field Details

  • Constructor Details

    • ClamScan

      public ClamScan()
    • ClamScan

      public ClamScan(String host, int port, int timeout)
  • Method Details

    • stats

      public String stats()
    • ping

      public boolean ping()
    • cmd

      public String cmd(byte[] cmd)
    • scan

      public ScanResult scan(byte[] in) throws IOException
      The method to call if you already have the content to scan in-memory as a byte array.
      Parameters:
      in - the byte array to scan
      Returns:
      the result of the scan
      Throws:
      IOException
    • scan

      public ScanResult scan(InputStream in)
      The preferred method to call. This streams the contents of the InputStream to clamd, so the entire content is not loaded into memory at the same time.
      Parameters:
      in - the InputStream to read. The stream is NOT closed by this method.
      Returns:
      a ScanResult representing the server response
    • getHost

      public String getHost()
    • setHost

      public void setHost(String host)
    • getPort

      public int getPort()
    • setPort

      public void setPort(int port)
    • getTimeout

      public int getTimeout()
    • setTimeout

      public void setTimeout(int timeout)
      Socket timeout in milliseconds
      Parameters:
      timeout - socket timeout in milliseconds