먼저 설치된 바이러스 백신 소프트웨어가 어떤 종류의 API를 제공하는지 확인해야합니다.
다음 아래를 사용해야합니다 (AVG의 API 등) 제공하는 자바 API가있는 경우에는 자바 API가 설치된 안티 바이러스 소프트웨어가 제공되지 않는 경우
public void scanFile(byte[] fileBytes, String fileName)
throws IOException, Exception {
if (scan) {
AVClient avc = new AVClient(avServer, avPort, avMode);
if (avc.scanfile(fileName, fileBytes) == -1) {
throw new VirusException("WARNING: A virus was detected in
your attachment: " + fileName + "<br>Please scan
your system with the latest antivirus software with
updated virus definitions and try again.");
}
}
}
는, 당신은 아직도 그것을 호출 할 수 있습니다 아래와 같이 명령 줄을 사용 :이 당신을 도와줍니다 Implementing an Anti-Virus File Scan in JEE Applications
희망 :
이
String[] commands = new String[5];
commands[0] = "cmd";
commands[1] = "/c";
commands[2] = "C:\\Program Files\\AVG\\AVG10\\avgscanx.exe";
commands[3] = "/scan=" + filename;
commands[4] = "/report=" + virusoutput;
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(commands);
참조에 대한 흥미로운 기사가있다.
안녕하세요, @Raptor 지금은 파일 업로드 모듈이 작동 중입니다. 나는 컨트롤러 수준에서 그 파일을 스캔하는 방법을 모르고 그 이유는 내가 시작할 수 있도록 포인터가 필요합니다. 나는 아이디어가 부족하여 아직 시작하지 않았다. – cooler