Git Product home page Git Product logo

clamav-java's Introduction

Simple ClamAV Java client. See also ClamAV REST service which builds on top of this.

Travis CI: Build Status

What is provided

Support for basic INSTREAM scanning and PING command.

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

A REST style API and server can be found from another repository, clamav-rest.

Using the client

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

  ClamAVClient cl = new ClamAVClient("192.168.50.72", 3310);
  byte[] reply;
  try {
    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");
  }

Maven dependency

<dependency>
  <groupId>fi.solita.clamav</groupId>
  <artifactId>clamav-client</artifactId>
  <version>1.0.1</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.

Alternatively, you could use Docker image to run ClamAV. Automated tests with Travis CI run using Docker image for ClamAV. The test image runs with artificially low MaxStreamLength setting on purpose.

Contributors

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.

clamav-java's People

Contributors

lokori avatar anttivi-solita avatar drogin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.