How to Scan an AWS S3 File for Viruses in Java

Are you using an AWS S3 file to store valuable content for your business? If so, you should take steps to ensure the safety of your information, as cloud storage is steadily becoming a main target for cyberattacks. By utilizing the following API, you will be checking the content of your file against a database of over 17 million virus signatures and malware, giving you a great start on protecting your business and clients from potential infection.

Image for post
Image for post

First off, let’s install the SDK with Maven by adding a reference to the repository in pom.xml:


Next, add a reference to the dependency in pom.xml:


Now, you can call the function with the following code:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.ScanCloudStorageApi;

Once the API is complete, you’ll receive a response identifying the virus (if found) or informing you that your content is resting safely without a virus in sight. Your personal API key can be retrieved from the Cloudmersive website; this will give you access to 800 monthly calls across our library of APIs.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store