Class VirusScannerImpl
- java.lang.Object
-
- io.mosip.kernel.virusscanner.clamav.impl.VirusScannerImpl
-
- All Implemented Interfaces:
VirusScanner<Boolean,InputStream>
@Component public class VirusScannerImpl extends Object implements VirusScanner<Boolean,InputStream>
The implementation Class for VirusScannerService.- Author:
- Mukul Puspam, Pranav Kumar
-
-
Field Summary
Fields Modifier and Type Field Description protected xyz.capybara.clamav.ClamavClientclamavClientThe clamav client.
-
Constructor Summary
Constructors Constructor Description VirusScannerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateConnection()Creates the connection to client.BooleanscanDocument(byte[] docArray)This Method is used to scan byte arrayBooleanscanDocument(File doc)This Method is used to scan FileBooleanscanFile(InputStream is)BooleanscanFile(String fileName)BooleanscanFolder(String folderPath)
-
-
-
Method Detail
-
createConnection
public void createConnection()
Creates the connection to client.
-
scanFile
public Boolean scanFile(String fileName)
- Specified by:
scanFilein interfaceVirusScanner<Boolean,InputStream>
-
scanFile
public Boolean scanFile(InputStream is)
- Specified by:
scanFilein interfaceVirusScanner<Boolean,InputStream>
-
scanFolder
public Boolean scanFolder(String folderPath)
- Specified by:
scanFolderin interfaceVirusScanner<Boolean,InputStream>
-
scanDocument
public Boolean scanDocument(byte[] docArray) throws IOException
This Method is used to scan byte array- Specified by:
scanDocumentin interfaceVirusScanner<Boolean,InputStream>- Parameters:
docArray- array- Returns:
- a true if file is virus free and false if file is infected
- Throws:
IOException- Signals that an I/O exception has occurred.
-
scanDocument
public Boolean scanDocument(File doc) throws IOException
This Method is used to scan File- Specified by:
scanDocumentin interfaceVirusScanner<Boolean,InputStream>- Parameters:
doc- object- Returns:
- a true if file is virus free and false if file is infected
- Throws:
IOException- Signals that an I/O exception has occurred.
-
-