在j2ee中集成赛门铁克防病毒扫描引擎
赛门铁克防病毒扫描引擎是一款企业级的杀毒引擎,并可以和各种环境进行集成,目前项目中需要在j2ee的环境中使用这个技术,故公布出实现方法供人参考。
为此目的专门开发了一个jar包用于和scan server 交互,关于这款产品的试用版下载:http://www.symantec.com/enterprise/products/trialware.jsp?pcid=1008&pvid=836_1
我将在文件下载中提供这个jar包的下载,名字为 virus-scan-connect.zip
以下的是最简单的实现步骤
0 install virus scan server
sse-installconfig-20061220
<1>, install the sse v51:
0, download trial version software and license.
http://symantec.com/enterprise/products/trialware.jsp?pcid=1008&pvid=836_1
1, install jdk 5; 2, install scanengine.exe, setup the admin port and password; 3, install license file
(1) by web console, https://ip:8004/; system-->license-->install.
[note, only with https is available.]
(2) copy license file to c:program filescommon filessymantec sharedlicenses;
4, working with icap;
1 virus scan in jsp
1 import the jar package- virusscan-0.1.jar
2 a simple implement practice is
1 sample invode code: 2 public static void main(string[] args) { 3 //icap://10.225.69.89:1344/avscan 是scan server的url 4 virusscanmanager vsm=new virusscanmanager("icap://10.225.69.89:1344/avscan"); 5 6 7 8 string testfile="./test/eicar.com.txt"; 9 inputstream in=null; 10 11 try { 12 //eicar是测试病毒代码 13 //in=new bytearrayinputstream(eicar.geteicar()); 14 in=new fileinputstream(testfile); 15 } catch (exception e) { e.printstacktrace(); 16 17 } vsm.processscanvirus("eicartestfile.txt", "plain/text", in); 18 19 } 20
|