Adam Jungen
Adam Jungen

Reputation: 437

How to scan a S3 file by command line in a Java application?

I need to scan a s3 object (jpeg, pdf) in my java application by Eset virus scanner.

S3Object s3Object = s3Client.getObject("bucket", "key);

So I get S3 object and here is the command line that I should use

@SBINDIR@/esets_scan [option(s)] FILES

How can I use this command line in a java application?

Upvotes: 0

Views: 186

Answers (1)

OscarRyz
OscarRyz

Reputation: 199234

You can execute the scan using ProcessBuilder

ProcessBuilder pb = new ProcessBuilder("esets_scan", "s3FileName");

Of course, you have to save your object to a file first and add more code to process the output of the scanner.

Upvotes: 1

Related Questions