How does SPE java sdk streaming file work?
search cancel

How does SPE java sdk streaming file work?

book

Article ID: 275364

calendar_today

Updated On:

Products

Protection Engine for Cloud Services

Issue/Introduction

Does SPE wait for the client to call 'Finish' API to start scanning the file? or

Does SPE start scanning after it has reached a set threshold

 

Environment

JAVA SDK for SPE 8.2.x-9.x

 

Resolution

public interface StreamScanRequest

The StreamScanRequest interface is the interface for stream-based scanning. The file is not accessible to Symantec Protection Engine in StreamScanRequest, it has to be streamed across to the Symantec Protection Engine for scanning. The clients receive an object of type StreamScanRequest from ScanEngine's createStreamScanRequest() method, and then invoke various methods defined in the interface.

There are two scenarios under which the chunks of data are streamed for scanning:

If the file is available with the client, then the file can be scanned by invoking scanFile(String fileName) method. This method opens the file, streams it across to Symantec Protection Engine, and gets the file or response back.

If the client does not have the file, it must call the send() method recursively for each chunk of data and then the finish() method in order to scan the entire file.