Hi ,
i am running clamscan from java as given below.
i am getting 56 as a return code.

Param with Value
---------------------------
destFilePath = /home/sudhakar/
fileName=Test Scan.doc (filename with space)

Method
-----------------------
private  void scanAntiVirus(String destFilePath, String fileName){
         Process p;
         int status;
         String absoulatepath= destFilePath + "/" + fileName;
               try {
                       String  command = CLAM_SCAN + destFilePath +
"\"" + fileName + "\"";
                       System.out.println("Scan Command:  "+ command);
                       //execute unix command
                       Runtime rt= Runtime.getRuntime();
                       p = rt.exec(command);
                       status = p.waitFor();
                       System.out.println("execute status: " + status);

                       p.destroy();


               }catch (InterruptedException e) {
                       deleteVirusFile(absoulateFilepath);
                       System.out.println(METHOD_NAME + "Error caught: " + e);
               }
}
Regards,
M.Sudhakar
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to