public class ClamAVScanner extends Object implements VirusScanner
| Modifier and Type | Field and Description |
|---|---|
static String |
CONNECTION_TIMEOUT_PROP
TCP / IP Connection time out
|
static String |
HOST_PROP
Host where the clamav daemon is listening
|
static String |
PORT_PROP
Port where daemon is listening
|
static String |
TEMP_DIR_PROP
Directory for temporary files
|
| Constructor and Description |
|---|
ClamAVScanner()
This constructor is necessary for reflection else you will get an ClassNotFoundException by
the VirusScannerFactory
|
| Modifier and Type | Method and Description |
|---|---|
void |
init(Properties properties)
Initialize the Scanner
|
void |
scan(byte[] bytes)
Scan a byte array for viruses
|
void |
scan(File file)
Scan file for virus
|
InputStream |
scan(InputStream stream)
Scan an input stream for virus.
|
public static final String TEMP_DIR_PROP
public static final String HOST_PROP
public static final String PORT_PROP
public static final String CONNECTION_TIMEOUT_PROP
public ClamAVScanner()
public void init(Properties properties) throws InitializeException
init in interface VirusScannerproperties - Init Properties. This will be used for individual settings.InitializeException - Thrown when initialization failspublic void scan(byte[] bytes)
throws VirusScannerException,
VirusFoundException
scan in interface VirusScannerbytes - Byte contentVirusScannerException - This Exception encapsulate any exceptionVirusFoundException - VirusScannerExceptionpublic void scan(File file) throws VirusScannerException, VirusFoundException
scan in interface VirusScannerfile - Scanning fileVirusScannerException - VirusScannerExceptionVirusFoundException - VirusFoundExceptionpublic InputStream scan(InputStream stream) throws VirusScannerException, VirusFoundException
scan in interface VirusScannerstream - Data streamtrue if a virus was detected else false, when
no virus was detectedVirusScannerException - This Exception encapsulate any exceptionVirusFoundException - This only thrown when a virus was foundCopyright © 2019 Communote team. All rights reserved.