How to create an empty folder on Google Storage with Google API?

前端 未结 7 2121
攒了一身酷
攒了一身酷 2020-12-15 05:18

How to create an empty folder on Google Storage with Google API? (Assume that / is path separator.)

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-15 05:59

    if you are using java SDK try this.

    Blob folderCreated = bucket.create(folder_name + "/", "".getBytes());
    
    1. folder_name should end with "/"
    2. upload empty bytes

提交回复
热议问题