Package clamavj
Class ClamScan
java.lang.Object
clamavj.ClamScan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncmd
(byte[] cmd) getHost()
int
getPort()
int
boolean
ping()
scan
(byte[] in) The method to call if you already have the content to scan in-memory as a byte array.scan
(InputStream in) The preferred method to call.void
void
setPort
(int port) void
setTimeout
(int timeout) Socket timeout in millisecondsstats()
-
Field Details
-
CHUNK_SIZE
public static final int CHUNK_SIZE- See Also:
-
-
Constructor Details
-
ClamScan
public ClamScan() -
ClamScan
-
-
Method Details
-
stats
-
ping
public boolean ping() -
cmd
-
scan
The method to call if you already have the content to scan in-memory as a byte array.- Parameters:
in
- the byte array to scan- Returns:
- the result of the scan
- Throws:
IOException
-
scan
The preferred method to call. This streams the contents of the InputStream to clamd, so the entire content is not loaded into memory at the same time.- Parameters:
in
- the InputStream to read. The stream is NOT closed by this method.- Returns:
- a ScanResult representing the server response
-
getHost
-
setHost
-
getPort
public int getPort() -
setPort
public void setPort(int port) -
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) Socket timeout in milliseconds- Parameters:
timeout
- socket timeout in milliseconds
-