Amazon s3 Folders Problem

后端 未结 5 1951
逝去的感伤
逝去的感伤 2020-12-10 08:52

I need off help regarding amazon s3 with folders,

The problem i get with the Amazon s3 class by undesigned is it doesnt support folders, it will only show you the fu

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-10 09:35

    So, Here's the work around. To list your directories you do this.

    
       `val objRequest = new ListObjectsRequest()
            .withBucketName("MY-BUCKET")
            .withPrefix("Music/").withDelimiter("/")
        val result     = s3Client.listObjects(objRequest)
        result.getCommonPrefixes()`
    

    This will list all the folders in MYBUCKET/Music.

    This is a away you get aroung with having a flat file store. (This is written in scala)

提交回复
热议问题