How to Check a Google Cloud Platform (GCP) File for Viruses in Java

When storing essential and confidential business content in a GCP storage file, you want to ensure the content is safe from threats. However, with the vast array of viruses and malware that are floating around in cyberspace, the possibility of an attack on your storage is ever-increasing. The following API can assist you with the security of your content by scanning a single GCP storage file for viruses, malware, trojans, ransomware, and spyware.

Image for post
Image for post

To use the Cloudmersive API, install the SDK with Maven by referencing the repository in pom.xml:


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


Then, you can call the function by entering the bucket name, object/file name, and JSON service account credential into 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;

In less than a second, our technology scans a continuously updated database of over 17 million virus signatures, returning a result indicating if the file is clean, or the virus name (if found). Head to the Cloudmersive website to gain access to your free API key and 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