Google cloud storage GCS:400错误请求检索存储桶
刚刚开始使用GCS及其JavaAPI。修改了Google Plus,我正在尝试检索一个bucket 我得到一个错误:Google cloud storage GCS:400错误请求检索存储桶,google-cloud-storage,bad-request,Google Cloud Storage,Bad Request,刚刚开始使用GCS及其JavaAPI。修改了Google Plus,我正在尝试检索一个bucket 我得到一个错误: 400 Bad Request { "code" : 400, "errors" : [ { "domain" : "global", "message" : "Invalid Value", "reason" : "invalid" } ], "message" : "Invalid Value" } 这是我的相关代码: 主要内容: 获
400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Value",
"reason" : "invalid"
} ],
"message" : "Invalid Value"
}
这是我的相关代码:
主要内容:
获取桶方法:
/** Get a BUCKET??? for which we already know the ID. */
private static void getBucket() throws IOException
{
View.header1("Retrieve a bucket by name.");
String bucketName = "gs://gsdogs";
Bucket bucket = storage.buckets().get(bucketName).execute();
View.show(bucket);
}
常数:
private static final String CLIENT_ID = "************.apps.googleusercontent.com";
private static final String KEY_FILE_NAME = "privatekey.p12";
private static final String APPLICATION_NAME = "Elf-MobileCCtv/1.0";
/** E-mail address of the service account. */
private static final String SERVICE_ACCOUNT_EMAIL = "************@developer.gserviceaccount.com";
/** Global instance of the HTTP transport. */
private static HttpTransport HTTP_TRANSPORT;
/** Global instance of the JSON factory. */
private static final JsonFactory JSON_FACTORY = new JacksonFactory();
// We are using GCS not Google plus.
private static Storage storage;
提前谢谢 我不得不将我的bucket名称从
gs://gsdogs
更改为gsdogs
。哇。我不得不将我的桶名从gs://gsdogs
改为gsdogs
。哇。在哪里?储存?以水桶的名义?啊,对不起,我不久就放弃了地面军事系统,从那以后就再也没有碰过它。我记得在哪里?储存?以水桶的名义?啊,对不起,我不久就放弃了地面军事系统,从那以后就再也没有碰过它。所以我记得:/
private static final String CLIENT_ID = "************.apps.googleusercontent.com";
private static final String KEY_FILE_NAME = "privatekey.p12";
private static final String APPLICATION_NAME = "Elf-MobileCCtv/1.0";
/** E-mail address of the service account. */
private static final String SERVICE_ACCOUNT_EMAIL = "************@developer.gserviceaccount.com";
/** Global instance of the HTTP transport. */
private static HttpTransport HTTP_TRANSPORT;
/** Global instance of the JSON factory. */
private static final JsonFactory JSON_FACTORY = new JacksonFactory();
// We are using GCS not Google plus.
private static Storage storage;