public class LocalScannerBase
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected ScannerSettingsLoader |
settingsLoader |
| Modifier | Constructor and Description |
|---|---|
protected |
LocalScannerBase(android.content.Context context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkScanBufferExceptions(byte[] buffer)
Checks for exceptions before scanning a buffer.
|
protected void |
checkScanBufferExceptions(byte[] buffer,
ThreatHandler threatHandler)
Checks for exceptions before scanning a buffer.
|
protected void |
checkScanFileExceptions(java.io.File file)
Checks for exceptions before scanning a file.
|
protected void |
checkScanFileExceptions(java.io.File file,
ThreatHandler threatHandler)
Checks for exceptions before scanning a file.
|
protected void |
checkScanStringExceptions(java.lang.String string)
Checks for exceptions before scanning a string.
|
protected void |
checkScanStringExceptions(java.lang.String string,
ThreatHandler threatHandler)
Checks for exceptions before scanning a string.
|
protected void |
checkWriteStoragePermission()
Checks if android.permission.WRITE_EXTERNAL_STORAGE is granted before scanning a file.
|
boolean |
isLicenseLoaded()
Checks if the license is loaded.
|
boolean |
isSettingsLoaded()
Checks if the settings are loaded.
|
void |
loadLicense(java.io.File licenseFile)
Loads the license from a file.
|
void |
loadLicense(java.lang.String license)
Loads the license from a string.
|
protected void |
loadSettings(java.io.File settingsFile)
Loads the settings from a file.
|
protected void |
loadSettings(java.lang.String settings)
Loads the settings from a string.
|
protected ScannerSettingsLoader settingsLoader
protected LocalScannerBase(android.content.Context context)
context - The Context.public void loadLicense(java.io.File licenseFile)
throws InvalidLicenseException,
java.io.IOException,
java.lang.Exception
licenseFile - The file containing the license.InvalidLicenseException - If the license is invalid.java.io.IOException - If there was an error reading the file.java.lang.Exception - Generic exception.public void loadLicense(java.lang.String license)
throws InvalidLicenseException,
java.lang.Exception
license - The string containing the license.InvalidLicenseException - If the license is invalid.java.lang.Exception - Generic exception.protected void loadSettings(java.io.File settingsFile)
throws SettingsException,
NoPermissionException,
java.io.IOException,
java.lang.Exception
settingsFile - The file containing the settings.SettingsException - If there was an error loading the settings.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.java.io.IOException - If there was an error reading the file.java.lang.Exception - Generic exception.protected void loadSettings(java.lang.String settings)
throws SettingsException,
NoPermissionException,
java.lang.Exception
settings - The string containing the settings.SettingsException - If there was an error loading the settings.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.java.lang.Exception - Generic exception.public boolean isLicenseLoaded()
public boolean isSettingsLoaded()
protected void checkScanFileExceptions(java.io.File file)
throws LicenseException,
SettingsException,
NoPermissionException,
java.io.IOException
file - The file to be scanned.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.java.io.IOException - If there was an error reading the file.protected void checkScanFileExceptions(java.io.File file,
ThreatHandler threatHandler)
throws LicenseException,
SettingsException,
NoPermissionException,
java.io.IOException
file - The file to be scanned.threatHandler - The custom handler that returns and handles the threat.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.java.io.IOException - If there was an error reading the file.protected void checkScanStringExceptions(java.lang.String string)
throws LicenseException,
SettingsException,
NoPermissionException
string - The string to be scanned.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.protected void checkScanStringExceptions(java.lang.String string,
ThreatHandler threatHandler)
throws LicenseException,
SettingsException,
NoPermissionException
string - The string to be scanned.threatHandler - The custom handler that returns and handles the threat.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.protected void checkScanBufferExceptions(byte[] buffer)
throws LicenseException,
SettingsException,
NoPermissionException
buffer - The buffer to be scanned.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.protected void checkScanBufferExceptions(byte[] buffer,
ThreatHandler threatHandler)
throws LicenseException,
SettingsException,
NoPermissionException
buffer - The buffer to be scanned.threatHandler - The custom handler that returns and handles the threat.LicenseException - If license is not loaded.SettingsException - If settings are not loaded.NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.protected void checkWriteStoragePermission()
throws NoPermissionException
NoPermissionException - If android.permission.WRITE_EXTERNAL_STORAGE is not granted.