Dev Time
Published in

Dev Time

AWS S3 file Operations with JAVA

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. 💻

--

--

--

Recommended from Medium

Stateful Autonomous Agents

Wazuh & Sysmon “Quick Setup and a Brief Overview”

Configure HTTPD server and setup Python Interpreter on Docker Container

Yet another writing on AWS Networking Specialty Certification

Journey of Nim Mastery

Container Adoption Trends & Best Practices: The DevGraph Webinar Series

Dear engineers, build-in quality!

Seven Tips For Using Fluentd For Logs Collection

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
Naveen Kumar M N

Naveen Kumar M N

Java Developer

More from Medium

Simple AWS lambda using java

Example of Spring Cloud Function with AWS Lambda

What Is Kubernetes Pods

AWS EC2 with Java SDK — Part 2