public class IcapScanFile extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ERROR_SEND_ARG |
static String |
FILE_ARG |
static String |
MODEL_ARG |
static String |
SEPARATOR_SEND |
static String |
SERVICE_ARG |
static int |
STATUS_BAD_ARGUMENT |
static int |
STATUS_ICAP_ISSUE |
static int |
STATUS_KO_SCAN |
static int |
STATUS_KO_SCAN_POST_ACTION_ERROR |
static int |
STATUS_NETWORK_ISSUE |
static int |
STATUS_OK |
static String |
TO_ARG |
Modifier and Type | Method and Description |
---|---|
static void |
finalizeOnError(IcapScanFile icapScanFile)
Finalize the current ICAP scan when an error occurs
|
String |
getFilePath() |
static IcapClient |
getIcapClient(IcapScanFile icapScanFile)
Create the IcapClient according to IcapScanFile
|
IcapModel |
getIcapModel() |
static IcapScanFile |
getIcapScanFileArgs(String[] args)
If file argument are -file EICARTEST, then a EICAR test file will be
sent.
|
WaarpLogLevel |
getLogLevel() |
String |
getPathMoveError() |
Map<String,String> |
getResult() |
String |
getServerIP() |
boolean |
isDeleteOnError() |
boolean |
isIgnoreNetworkError() |
boolean |
isIgnoreTooBigFileError() |
boolean |
isSendOnError() |
static void |
main(String[] args)
If file argument are -file EICARTEST, then a EICAR test file will be
sent.
|
static void |
printHelp()
Print to standard output the help of this command
|
int |
scanFile()
Scan a file through ICAP antivirus server from IcapScanFile
|
static int |
scanFile(String[] args)
If file argument are -file EICARTEST, then a EICAR test file will be
sent.
|
static int |
scanFile(String[] model,
String[] args)
If file argument are -file EICARTEST, then a EICAR test file will be
sent.
|
IcapScanFile |
setFilePath(String filePath) |
IcapScanFile |
setServerIP(String serverIP) |
public static final int STATUS_OK
public static final int STATUS_BAD_ARGUMENT
public static final int STATUS_ICAP_ISSUE
public static final int STATUS_NETWORK_ISSUE
public static final int STATUS_KO_SCAN
public static final int STATUS_KO_SCAN_POST_ACTION_ERROR
public static final String FILE_ARG
public static final String TO_ARG
public static final String SERVICE_ARG
public static final String MODEL_ARG
public static final String ERROR_SEND_ARG
public static final String SEPARATOR_SEND
public static void printHelp()
public static IcapScanFile getIcapScanFileArgs(String[] args) throws IcapException
args
- must be already replaced values (getReplacedValue)IcapException
- if an error occurs during argument parsingpublic static IcapClient getIcapClient(IcapScanFile icapScanFile)
icapScanFile
- used to setup IcapClientpublic static void finalizeOnError(IcapScanFile icapScanFile) throws IOException
icapScanFile
- used to get options for Error tasksIOException
- if an error occurs during post error taskspublic final String getFilePath()
public final IcapScanFile setFilePath(String filePath)
filePath
- the file path to usepublic final String getServerIP()
public final IcapScanFile setServerIP(String serverIP)
serverIP
- the server IP to usepublic final IcapModel getIcapModel()
public final String getPathMoveError()
public final boolean isDeleteOnError()
public final boolean isSendOnError()
public final boolean isIgnoreNetworkError()
public final boolean isIgnoreTooBigFileError()
public final WaarpLogLevel getLogLevel()
public final Map<String,String> getResult()
public static void main(String[] args)
args
- to get parameters frompublic static int scanFile(String[] model, String[] args)
model
- default model to apply in addition to parametersargs
- to get parameters frompublic static int scanFile(String[] args)
args
- to get parameters frompublic final int scanFile() throws IcapException, IOException
IcapException
- if an error occurs during connection or ICAP protocolIOException
- if the file is infected and a post error action is
in errorCopyright © 2009–2022 Waarp. All rights reserved.