clamav-client

A solid client in Java to communicate with ClamAV

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

hu.alphabox
Идентификатор

Идентификатор

clamav-client
Последняя версия

Последняя версия

0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

clamav-client
A solid client in Java to communicate with ClamAV
Ссылка на сайт

Ссылка на сайт

https://github.com/alphabox/clamav-client
Система контроля версий

Система контроля версий

https://github.com/alphabox/clamav-client

Скачать clamav-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/hu.alphabox/clamav-client/ -->
<dependency>
    <groupId>hu.alphabox</groupId>
    <artifactId>clamav-client</artifactId>
    <version>0.1</version>
</dependency>
// https://jarcasting.com/artifacts/hu.alphabox/clamav-client/
implementation 'hu.alphabox:clamav-client:0.1'
// https://jarcasting.com/artifacts/hu.alphabox/clamav-client/
implementation ("hu.alphabox:clamav-client:0.1")
'hu.alphabox:clamav-client:jar:0.1'
<dependency org="hu.alphabox" name="clamav-client" rev="0.1">
  <artifact name="clamav-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='hu.alphabox', module='clamav-client', version='0.1')
)
libraryDependencies += "hu.alphabox" % "clamav-client" % "0.1"
[hu.alphabox/clamav-client "0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.slf4j : slf4j-api jar 1.7.25

test (1)

Идентификатор библиотеки Тип Версия
ch.qos.logback : logback-classic jar 1.2.3

Модули Проекта

Данный проект не имеет модулей.

clamav-client

Introduction

clamav-client is a simple, solid library in Java to communicate with ClamaAV daemon. You can send any message type (typically email) for ClamAV to check for viruses.

The library implements all commands, except which only works on UNIX domain sockets. You can find more information on clamd manual.

Maven dependency

<dependency>
    <groupId>hu.alphabox</groupId>
    <artifactId>clamav-client</artifactId>
    <version>0.1</version>
</dependency>

Building

To make the clamav-client-0.1-SNAPSHOT.jar, you will need the Apache Maven installed. Run the following command:

mvn clean package

Simple Usage

A simple usage example to send EICAR message with the simplest implementation.

public static void main(String[] args) throws Exception {
    ClamAVClient client = new ClamAVClient("localhost", 3310);
    //EICAR message string
    String message = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*";
    String reply = client.sendCommand(new InStreamCommand(message));
    LOGGER.info("Reply of the message: {}", reply);
}

Async usage

Send messages in async mode with only one connection (Session mode). You get the results as a Future.

public static void main(String[] args) throws Exception {
	List<Future<String>> result = new ArrayList<>();
	try (ClamAVAsyncSessionClient client = new ClamAVAsyncSessionClient("192.168.1.105", 3310)) {
		String message = "X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*";		
		for(int i = 0; i < 1000; i++) {
			result.add(client.sendCommand(new InStreamCommand(message)));
		}
		//Collections.shuffle(result);
		for(Future<String> future : result) {
			LOGGER.info(future.get());
		}
	}
}

License

This project licensed under Apache 2.0 License - see the LICENSE file for details

Версии библиотеки

Версия
0.1