Skip to content

Simple ClamAV client for streaming data to clamd server

License

Notifications You must be signed in to change notification settings

bmeriaux/clamav-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple ClamAV Java client

What is provided

Support for basic INSTREAM scanning and PING command.

Clamd protocol is explained here: http://linux.die.net/man/8/clamd

Using the client

Code is self explanatory. Something like this is the idea:

  ClamAVClient cl = new ClamAVClient("192.168.50.72", 3310);
  try {
    byte[] reply = cl.scan(input);
  } catch (Exception e) {
    throw new RuntimeException("Could not scan the input", e);
  }
  if (!ClamAVClient.isCleanReply(reply)) throw new Exception("aaargh. Something was found: ", reply);

Maven dependency

<dependency>
  <groupId>fi.solita.clamav</groupId>
  <artifactId>clamav-client</artifactId>
  <version>1.0.0</version>
</dependency>

Creating the jar

mvn install

Testing the client

To run the automated tests you are assumed to run the clamd in a local virtual machine. Configuration for Vagrant and Oracle Virtualbox is provided.

To start test server simply

cd vagrant
vagrant up clamav

This will kick up a CentOS virtual machine and install ClamAV in it.

License

Copyright © 2014 Solita

Distributed under the GNU Lesser General Public License, either version 2.1 of the License, or (at your option) any later version.

About

Simple ClamAV client for streaming data to clamd server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 85.0%
  • Ruby 10.6%
  • Shell 4.4%