Package org.primefaces.virusscan.impl
Class ClamDaemonScanner
- java.lang.Object
-
- org.primefaces.virusscan.impl.ClamDaemonScanner
-
- All Implemented Interfaces:
VirusScanner
public class ClamDaemonScanner extends Object implements VirusScanner
ClamAV Daemon customVirusScannerprovider bundled with PrimeFaces. Streams the file over TCP to a ClamAV service running on host:port. It requiresCONTEXT_PARAM_HOSTandCONTEXT_PARAM_PORTto be specified.
-
-
Constructor Summary
Constructors Constructor Description ClamDaemonScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateErrorMessage(UploadedFile file, String response)booleanisEnabled()Indicate whether thisVirusScanneris enabled or not.voidscan(UploadedFile file)Scan file using send to ClamAV service running at host and port over TCP.
-
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Description copied from interface:VirusScannerIndicate whether thisVirusScanneris enabled or not.- Specified by:
isEnabledin interfaceVirusScanner- Returns:
trueif enabled,falseotherwise
-
scan
public void scan(UploadedFile file)
Scan file using send to ClamAV service running at host and port over TCP.- Specified by:
scanin interfaceVirusScanner- Parameters:
file- file to perform virus scan on- Throws:
VirusException- if a virus has been detected by the scanner
-
createErrorMessage
protected String createErrorMessage(UploadedFile file, String response)
-
-