dsyua2828 2019-06-11 16:56
浏览 55
已采纳

从S3目录的指定列表中检索内容

Is there a way to retrieve list of all files from specified list of directories at specific S3 bucket by invoking cloud API only once?

For example, lets say that I have following structure at my S3 cloud service:

A/
 AA/
   XXX/

B/
 BB/
   /EMPTY

C/
 /EMPTY

D/
 DD/
   XXX/

And that I also have list of directories from which I wish to retrieve content:

Requested Paths: {
    "A/AA/XXX",
    "B/BB/XXX",
    "C/CC/XXX",
    "D/DD/XXX"
}

I would like to create a map with key/value pairs where key is represented by specific directory path, and value is represented by its content. If path does not exist then key/value pair should not exist ether. Something like this:

Map {
   "A/AA/XXX" : Content
   "D/DD/XXX" : Content
}

Note that there are no keys that correspond to B/BB/XXX and C/CC/XXX since XXX is not part of B/BB//path and CC/XXX is not part of C/ path ether.

  • 写回答

1条回答 默认 最新

  • doujia2090 2019-06-11 17:11
    关注

    Not with a single call, no - particularly if you have enough objects to trigger paginated results. ListObjects takes a ListObjectsInput where Prefix is a single string, not a slice/array.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助