GAE java用GCS客户端库模拟云存储时,哪些文件uri? [英] which are the files uri on GAE java emulating cloud storage with GCS client library?

查看:132
本文介绍了GAE java用GCS客户端库模拟云存储时,哪些文件uri?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用适用于Java的Google应用程序引擎开发Web应用程序. 我将使用Google Cloud存储,并根据文档,我正在使用GCS客户端库来模拟本地磁盘上的云存储.

I'm developing a web application using Google app engine for Java. I will use Google Cloud storage and according to the documentation, I'm using GCS client library to emulate cloud storage on local disk.

保存文件没有问题,我可以从war文件夹下的eclipse中看到它们(在WEB-INF/appengine-generate生成的路径下),并且可以从url

I have no problem saving the files, I can see them from eclipse under the war folder (under the path WEB-INF/appengine-generated) and I can see them from the web admin panel accessible from the url

localhost:8888/_ah/admin

localhost:8888/_ah/admin

如该问题

我的问题如下.本地主机下有哪些文件URI可以通过GCS仿真来访问它们?

My question is the following. Which are the files URI under localhost to access them with GCS emulation?

本地主机上已上传文件之一的示例:

Example of one of uploaded files on localhost:

  • 文件密钥为aglub19hcHBfaWRyJwsSF19haF9GYWtlQ2xvdWRTdG9yYWdlX18xIgpxcmNvZGUuanBnDA
  • ID/名称已编码_gs_key:L2dzLzEvcXJjb2RlLmpwZw
  • 文件名为/gs/1/qrcode.jpg

谢谢.

推荐答案

您可以在此处查看操作方法:

You can see how this is done here: https://code.google.com/p/appengine-gcs-client/source/browse/trunk/java/src/main/java/com/google/appengine/tools/cloudstorage/dev/LocalRawGcsService.java

到目前为止,此映射是通过使用本地数据存储来维护的.将来可能会有所改变,但是您应该能够简单地调用此类或GCS客户端随附的更高级别的类别之一来获取数据.

As of today this mapping is being maintained by the using the local datastore. This may change in the future, but you should be able to simply call into this class or one of the higher level classes provided with the GCS client to get at the data.

这篇关于GAE java用GCS客户端库模拟云存储时,哪些文件uri?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆