public class ClamavClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static Platform |
DEFAULT_SERVER_PLATFORM |
static int |
DEFAULT_SERVER_PORT |
| Constructor and Description |
|---|
ClamavClient(InetSocketAddress server)
Creates a ClamavClient which will connect to the ClamAV daemon on the given socket address.
|
ClamavClient(InetSocketAddress server,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given socket address running on the given platform.
|
ClamavClient(String serverHostname)
+
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname.
|
ClamavClient(String serverHostname,
int serverPort)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port.
|
ClamavClient(String serverHostname,
int serverPort,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port running on the given platform.
|
ClamavClient(String serverHostname,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname running on the given platform.
|
| Modifier and Type | Method and Description |
|---|---|
ScanResult |
parallelScan(Path path)
Scans a file/directory on the filesystem of the ClamAV daemon and will continue the scan to the end
even if a virus has been found.
|
void |
ping()
Pings the ClamAV daemon.
|
void |
reloadVirusDatabases()
Triggers the virus databases reloading by the ClamAV daemon
|
ScanResult |
scan(InputStream inputStream)
Scans an
InputStream and sends a response as soon as a virus has been found. |
ScanResult |
scan(Path path)
Scans a file/directory on the filesystem of the ClamAV daemon and sends a response as soon as a virus has been found.
|
ScanResult |
scan(Path path,
boolean continueScan)
Scans a file/directory on the filesystem of the ClamAV daemon and may continue the scan to the end
even if a virus has been found, depending on the
continueScan argument. |
void |
shutdownServer()
Immediately shutdowns the ClamAV daemon
|
String |
stats()
Requests stats from the ClamAV daemon
|
String |
version()
Requests the version of the ClamAV daemon
|
public static final int DEFAULT_SERVER_PORT
public static final Platform DEFAULT_SERVER_PLATFORM
public ClamavClient(String serverHostname)
serverHostname - Server hostnamepublic ClamavClient(String serverHostname, int serverPort)
serverHostname - Server hostnameserverPort - Server portpublic ClamavClient(String serverHostname, Platform serverPlatform)
serverHostname - Server hostnameserverPlatform - Server platform
(determines the file path separator to use when launching a file/directory scan
on the server filesystem)public ClamavClient(String serverHostname, int serverPort, Platform serverPlatform)
serverHostname - Server hostnameserverPort - Server portserverPlatform - Server platform
(determines the file path separator to use when launching a file/directory scan
on the server filesystem)public ClamavClient(InetSocketAddress server)
server - Server socket address (IP address and port or hostname and port)public ClamavClient(InetSocketAddress server, Platform serverPlatform)
server - Server socket address (IP address and port or hostname and port)serverPlatform - Server platform
(determines the file path separator to use when launching a file/directory scan
on the server filesystem)public void ping()
throws ClamavException
ClamavException is thrown.ClamavException - Exception holding the real cause of malfunctionpublic String version() throws ClamavException
ClamavException - Exception holding the real cause of malfunctionpublic String stats() throws ClamavException
ClamavException - Exception holding the real cause of malfunctionpublic void reloadVirusDatabases()
throws ClamavException
ClamavException - Exception holding the real cause of malfunctionpublic void shutdownServer()
throws ClamavException
ClamavException - Exception holding the real cause of malfunctionpublic ScanResult scan(InputStream inputStream) throws ClamavException
InputStream and sends a response as soon as a virus has been found.inputStream - inputStream to scanClamavException - Exception holding the real cause of malfunctionpublic ScanResult scan(Path path) throws ClamavException
path - absolute path to the file/directory on the filesystem of the ClamAV daemonClamavException - Exception holding the real cause of malfunctionpublic ScanResult scan(Path path, boolean continueScan) throws ClamavException
continueScan argument.path - absolute path to the file/directory on the filesystem of the ClamAV daemoncontinueScan - continue the scan to the end even if the virus has been foundClamavException - Exception holding the real cause of malfunctionpublic ScanResult parallelScan(Path path) throws ClamavException
path - absolute path to the file/directory on the filesystem of the ClamAV daemonClamavException - Exception holding the real cause of malfunctionCopyright © 2017. All rights reserved.