Package org.craftercms.virusscanner.impl
Class ClamavVirusScannerImpl
java.lang.Object
org.craftercms.virusscanner.impl.ClamavVirusScannerImpl
- All Implemented Interfaces:
VirusScanner
A virus scanner that uses ClamScan to scan input-streams/files
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()
int
getPort()
int
void
scan
(InputStream inputStream) Scans theInputStream
for viruses.void
Scans the file for virus.void
void
setPort
(int port) void
setTimeout
(int timeout)
-
Field Details
-
THREAT_FOUND_MESSAGE
- See Also:
-
FILE_NOT_FOUND_MESSAGE
- See Also:
-
SCAN_FAILED_MESSAGE
- See Also:
-
-
Constructor Details
-
ClamavVirusScannerImpl
public ClamavVirusScannerImpl() -
ClamavVirusScannerImpl
- Parameters:
host
- the clamd server hostport
- the clamd server porttimeout
- milliseconds to wait for the connection
-
-
Method Details
-
scan
Scans the file for virus.- Specified by:
scan
in interfaceVirusScanner
- Parameters:
filename
- full path
-
scan
Scans theInputStream
for viruses.- Specified by:
scan
in interfaceVirusScanner
- Parameters:
inputStream
-
-
setHost
- 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
- 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
-