package com.limegroup.gnutella.malware;
import java.io.File;
import java.io.IOException;
public interface VirusScanner {
/**
* @return true if virus scanning is supported on this platform and
* activated. This does not mean that scanning is enabled.
*/
boolean isSupported();
/**
* @return true if virus scanning is enabled and supported on the platform.
*/
boolean isEnabled();
/**
* @return the version of the installed virus definitions, or 0 if no
* definitions are installed. This method may block. It must not be called
* concurrently with <code>loadFullUpdate(File)</code> or
* <code>loadIncrementalUpdate(File)</code>.
*/
int getDefinitionsVersion();
/**
* @return the version of the virus scanner library.
*
* @throws IOException if the version could not be parsed.
*/
long getLibraryBuildVersion() throws IOException;
/**
* @return true if the file is infected. Do not call this method unless
* isSupported() returns true. This method blocks. The argument may be a
* directory.
*/
boolean isInfected(File file) throws VirusScanException;
/**
* Stops the <code>VirusScanner</code> after it completes any scheduled
* jobs.
*/
void stopScanner();
/**
* Stops the <code>VirusScanner</code> after it completes any scheduled
* jobs and moves a full update from the temporary directory to the
* database directory before any new jobs are started. This method blocks.
* @throws VirusScanException if an error occurs while moving the update,
* in which case the installed definitions may have been corrupted.
*/
void loadFullUpdate(File updateDir) throws VirusScanException;
/**
* Merges an incremental update from the temporary directory into the
* database directory and loads the updated definitions. This method blocks.
* @throws IOException if an error occurs while merging the update, in
* which case the installed definitions can continue to be used.
* @throws VirusScanException if an error occurs while moving the update,
* in which case the installed definitions may have been corrupted.
*/
void loadIncrementalUpdate(File updateDir) throws IOException, VirusScanException;
}