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

╄→尐↘猪︶ㄣ 提交于 2020-01-30 13:03:32

问题


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*/


回答1:


There is not another way.

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



来源:https://stackoverflow.com/questions/48378288/how-to-get-folder-size-which-consists-of-files-in-aws-using-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!