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 customVirusScanner
provider bundled with PrimeFaces. Streams the file over TCP to a ClamAV service running on host:port. It requiresCONTEXT_PARAM_HOST
andCONTEXT_PARAM_PORT
to be specified.
-
-
Constructor Summary
Constructors Constructor Description ClamDaemonScanner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
createErrorMessage(UploadedFile file, String response)
boolean
isEnabled()
Indicate whether thisVirusScanner
is enabled or not.void
scan(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:VirusScanner
Indicate whether thisVirusScanner
is enabled or not.- Specified by:
isEnabled
in interfaceVirusScanner
- Returns:
true
if enabled,false
otherwise
-
scan
public void scan(UploadedFile file)
Scan file using send to ClamAV service running at host and port over TCP.- Specified by:
scan
in 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)
-
-