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.

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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP