【发布时间】:2015-02-04 20:31:39
【问题描述】:
我正在通过 Java API 通过 Storage.Objects.Insert 实例将我的文件上传到 Google Cloud Storage。
一切正常,我可以设置我的 ACL 等,但我不确定如何在我上传的文件上设置元数据。主要是想扩展“Cache-Control”标头。
Insert 对象上有一个 set 方法,但没有记录在案,我不确定它在做什么。
我正在寻找一个 Java 等价于:
gsutil setmeta -h "Cache-Control:public, max-age=31536000" gs://{my_bucket}/{my_file}
而且我希望通过Insert对象上传文件的时候有办法设置这个header。
非常感谢任何帮助。
【问题讨论】:
标签: google-cloud-storage google-api-java-client