AWS S3 file Operations with JAVA

Naveen Kumar M N
Dev Time
Published in
2 min readAug 18, 2020

Cloud, it’s just someone else computer.

Buckets
Photo by Carolyn V on Unsplash

Storage is the key factor for every business model and yes its easy to design a reliable storage service on our own without stack overflow. 😵 (I must stop day dreaming)

What is AWS S3?

It stands for Simple Storage Service where we can store and retrieve data anytime. Its a part of Amazon Web Services which gives developers fast and affordable data storage infrastructure (Well you can smile at your credit card bill).

Why S3?

S3 has an user-friendly UI and supports various languages SDK which makes development a piece of cake(still dreaming 😴). It provides us with containers (known as buckets), manageable authorization.

Time to fire up Intellij. We are sticking with Java 8 and maven project (Sugavaneshwar S was lazy enough to download the jar)

Supplying credentials to access the bucket.

The BasicAWSCredentials method takes in access key ID and secret access key for authentication and authorization with an client object.

Create new bucket

Push a object to S3 bucket

Download a object from from S3

Delete a file from bucket.

Delete a bucket

Pat on the shoulder!!!!!!! ☁️

To view the complete code, checkout our repo. 💻

--

--