I installed ClamAV both on my Windows and Unix machine. Here is the sample code
I am using from Java
public boolean fileFactoryScanner (String destFilePath) throws Exception {
ClamAVScannerFactory.setClamdHost("127.0.0.1");
ClamAVScannerFactory.setClamdPort(3310);
ClamAVScanner scanner = ClamAVScannerFactory.getScanner();
DfLogger.info(com.vzwcorp.sics.clam.FileScanner.class, "Scanning File:
" + destFilePath, null, null);
InputStream inputStream = new FileInputStream(destFilePath);
boolean resScan=false;
if(inputStream!=null){
resScan = scanner.performScan(inputStream);
}else{
Logger.info("There is no Input stream");
}
return resScan;
}
Is this the right way to do it?
It works on windows with response true or false. On unix it doesn't
It gives me Scannerexception: Error while requesting protocol channel.
Can anybody help him with this? What needs to be changed in clamd.conf that can
make the above code work on port 3310
Thanks
Madhuri
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml