こちらをご覧ください:バッチ Java API
例えば:
BatchRequest batch = new BatchRequest(httpTransport, httpRequestInitializer);
batch.setBatchUrl(new GenericUrl(/*your customized batch URL goes here*/));
batch.queue(httpRequest1, dataClass, errorClass, callback);
batch.queue(httpRequest2, dataClass, errorClass, callback);
batch.execute();
次のことを覚えておいてください。
各部分の本体自体は、独自の動詞、URL、ヘッダー、および本体を備えた完全な HTTP 要求です。HTTP 要求には、URL のパス部分のみを含める必要があります。バッチ リクエストでは完全な URL は許可されません。
アップデート
こちらもご覧ください。Google Batch API を使用してバッチを作成する方法:
https://github.com/google/google-api-java-client
更新 2
次のようなことを試してください:
// Create the Storage service object
Storage storage = new Storage(httpTransport, jsonFactory, credential);
// Create a new batch request
BatchRequest batch = storage.batch();
// Add some requests to the batch request
storage.objectAccessControls().insert("bucket-name", "object-key1",
new ObjectAccessControl().setEntity("user-123423423").setRole("READER"))
.queue(batch, callback);
storage.objectAccessControls().insert("bucket-name", "object-key2",
new ObjectAccessControl().setEntity("user-guy@example.com").setRole("READER"))
.queue(batch, callback);
storage.objectAccessControls().insert("bucket-name", "object-key3",
new ObjectAccessControl().setEntity("group-foo@googlegroups.com").setRole("OWNER"))
.queue(batch, callback);
// Execute the batch request. The individual callbacks will be called when requests finish.
batch.execute();
ここから: Google Storage Json Api (JAVA) を使用したバッチ リクエスト