ClamAVj : a Java library for accessing the ClamAV clamd daemon

I wrote some code last week to scan files against the ClamAV antivirus scanner using the clamd daemon. It's up now on Google Code under the Apache 2.0 license.

4 thoughts on “ClamAVj : a Java library for accessing the ClamAV clamd daemon

  • May 31, 2010 at 12:30 am
    Permalink

    Passing 0-size byte array to scan(byte[] in) fails. Easy to fix, though:

    * now *
    try {
    read = in.read(buffer);
    }

    * should be *
    try {
    read = in.read(buffer);
    if (read == -1) {
    break;
    }
    }

  • September 19, 2010 at 4:01 am
    Permalink

    thanks!
    exactly what i was looking for :)

  • February 8, 2011 at 8:13 am
    Permalink

    It seems to me that, when the socket times out (while reading the response back in method scan), ClamScan will end up thinking the file contains a virus (because the response, in that case, contains a blank string).

  • May 6, 2011 at 9:11 am
    Permalink

    Thanks for posting this. These classes are extremely helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">