Package clamavj
Class ClamScan
- java.lang.Object
-
- clamavj.ClamScan
-
public class ClamScan extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static intCHUNK_SIZE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringcmd(byte[] cmd)StringgetHost()intgetPort()intgetTimeout()booleanping()ScanResultscan(byte[] in)The method to call if you already have the content to scan in-memory as a byte array.ScanResultscan(InputStream in)The preferred method to call.voidsetHost(String host)voidsetPort(int port)voidsetTimeout(int timeout)Socket timeout in millisecondsStringstats()
-
-
-
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
-
-