public class ClamavClient
Kotlin ClamAV client
| Modifier and Type | Class and Description |
|---|---|
static class |
ClamavClient.Companion |
| Modifier and Type | Field and Description |
|---|---|
static ClamavClient.Companion |
Companion |
static Platform |
DEFAULT_SERVER_PLATFORM |
static int |
DEFAULT_SERVER_PORT |
| Constructor and Description |
|---|
ClamavClient(java.net.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(java.net.InetSocketAddress server)
Creates a ClamavClient which will connect to the ClamAV daemon on the given socket address running on the given platform.
|
ClamavClient(java.lang.String serverHostname,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname running on the given platform.
|
ClamavClient(java.lang.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(java.lang.String serverHostname,
int serverPort)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port running on the given platform.
|
ClamavClient(java.lang.String serverHostname)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port running on the given platform.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.InetSocketAddress |
getServer()
Server socket address
|
Platform |
getServerPlatform()
Server platform
|
ScanResult |
parallelScan(java.nio.file.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.
This method may improve performances on SMP systems by performing a multi-threaded scan.
|
void |
ping()
Pings the ClamAV daemon. If a correct response has been received, the method simply returns.
Otherwise, a
exception ClamavException is thrown. |
void |
reloadVirusDatabases()
Triggers the virus databases reloading by the ClamAV daemon
|
ScanResult |
scan(java.io.InputStream inputStream)
Scans an
InputStream and sends a response as soon as a virus has been found. |
ScanResult |
scan(java.nio.file.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. |
ScanResult |
scan(java.nio.file.Path path)
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
|
java.lang.String |
stats()
Requests stats from the ClamAV daemon
|
java.lang.String |
version()
Requests the version of the ClamAV daemon
|
public static int DEFAULT_SERVER_PORT
public static Platform DEFAULT_SERVER_PLATFORM
public static ClamavClient.Companion Companion
public ClamavClient(java.net.InetSocketAddress server,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given socket address running on the given platform.
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 ClamavClient(java.net.InetSocketAddress server)
Creates a ClamavClient which will connect to the ClamAV daemon on the given socket address running on the given platform.
server - Server socket address (IP address and port or hostname and port)public ClamavClient(java.lang.String serverHostname,
Platform serverPlatform)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname running on the given platform.
Default values: Port: 3310
serverHostname - Server hostnameserverPlatform - Server platform (determines the file path separator to use when launching a file/directory scan on the server filesystem)public ClamavClient(java.lang.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.
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(java.lang.String serverHostname,
int serverPort)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port running on the given platform.
serverHostname - Server hostnameserverPort - Server portpublic ClamavClient(java.lang.String serverHostname)
Creates a ClamavClient which will connect to the ClamAV daemon on the given hostname and port running on the given platform.
serverHostname - Server hostnamepublic void ping()
Pings the ClamAV daemon. If a correct response has been received, the method simply returns.
Otherwise, a exception ClamavException is thrown.
exception ClamavExceptionpublic java.lang.String version()
Requests the version of the ClamAV daemon
public java.lang.String stats()
Requests stats from the ClamAV daemon
public void reloadVirusDatabases()
Triggers the virus databases reloading by the ClamAV daemon
public void shutdownServer()
Immediately shutdowns the ClamAV daemon
public ScanResult scan(java.io.InputStream inputStream)
Scans an InputStream and sends a response as soon as a virus has been found.
inputStream - inputStream to scanpublic ScanResult scan(java.nio.file.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.
path - absolute path to the file/directory on the filesystem of the ClamAV daemoncontinueScan - continue the scan to the end even if a virus has been foundpublic ScanResult scan(java.nio.file.Path path)
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.
path - absolute path to the file/directory on the filesystem of the ClamAV daemonpublic ScanResult parallelScan(java.nio.file.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. This method may improve performances on SMP systems by performing a multi-threaded scan.
path - absolute path to the file/directory on the filesystem of the ClamAV daemonpublic java.net.InetSocketAddress getServer()
Server socket address
(IP address and port or hostname and port)
public Platform getServerPlatform()
Server platform
(determines the file path separator to use when launching a file/directory scan on the server filesystem)