Sai Vijay
Sai Vijay

Reputation: 21

how to get folder size which consists of files in aws using java

lets think we have bucket with name "bucket1" and inside that having a folder with name 'new folder' Inside 'new folder' are files
new folder/a1.pdf-->2mb
new folder/a2.pdf-->2mb
new folder/new folder2/b.pdf-->3mb

when we use amazons3client.listObjects("bucket1","new folder")---->it will return the list of files and folders inside that for each 's3object' there is 'size' parameter i can loop through all those s3 objects and i can get folder size but it is heavy operation.

/* will you please any another way to get folder size*/

Upvotes: 0

Views: 191

Answers (1)

Michael - sqlbot
Michael - sqlbot

Reputation: 179374

There is not another way.

The "folder" is not a container in S3 so it has no size, itself.

Upvotes: 1

Related Questions