diff --git a/src/main/java/com/lafaspot/icap/client/IcapClient.java b/src/main/java/com/lafaspot/icap/client/IcapClient.java index 08b9ebf..dc87a27 100644 --- a/src/main/java/com/lafaspot/icap/client/IcapClient.java +++ b/src/main/java/com/lafaspot/icap/client/IcapClient.java @@ -135,6 +135,21 @@ public Future scanFile(@Nonnull final URI server, @Nonnull final Str throw new IcapException(FailureType.NOT_CONNECTED, e); } } + + /** + * API to scan a file, will return a future object to be polled for result. + * + * @param server URI pointing to the Symantec AV scan server + * @param filename name of the file to be scanned + * @param toScanFile byte stream of the file to be scanned + * @return the future object + * @throws IcapException on failure + */ + public Future scanFileWithOutSessionReuse(@Nonnull final URI server, @Nonnull final String filename, @Nonnull final byte[] toScanFile) + throws IcapException { + IcapSession sess = connect(server); + return sess.scanFile(filename, toScanFile); + } /** * Create a new IcapSession and connect to server.