Package clamavj
Class ClamScan
- java.lang.Object
-
- clamavj.ClamScan
-
public class ClamScan extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
CHUNK_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
cmd(byte[] cmd)
String
getHost()
int
getPort()
int
getTimeout()
boolean
ping()
ScanResult
scan(byte[] in)
The method to call if you already have the content to scan in-memory as a byte array.ScanResult
scan(InputStream in)
The preferred method to call.void
setHost(String host)
void
setPort(int port)
void
setTimeout(int timeout)
Socket timeout in millisecondsString
stats()
-
-
-
Field Detail
-
CHUNK_SIZE
public static final int CHUNK_SIZE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClamScan
public ClamScan()
-
ClamScan
public ClamScan(String host, int port, int timeout)
-
-
Method Detail
-
stats
public String stats()
-
ping
public boolean ping()
-
cmd
public String cmd(byte[] cmd)
-
scan
public ScanResult scan(byte[] in) throws IOException
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
public ScanResult scan(InputStream in)
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
public String getHost()
-
setHost
public void setHost(String host)
-
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
-
-