For a project I'm doing, I will have files stored in Google's Cloud Storage and am building a web app to interface to those files. I would like my app to show a list of the files (or objects may be the appropriate name) stored in my bucket. I'm completely new to web development and google apis.
I've been researching how to do this and have found this bit of code...
Storage storage = new Storage(httpTransport, jsonFactory, credential);
ObjectsList list = storage.objects().list("bucket-name").execute();
for (Object obj : list.getItems()) {
}
and it is stated to use an AppIdentityCredential.
Any advice on how to use the above code along with an AppIdentityCredential or any advice on listing files stored in a bucket using java would be greatly appreciated.
This should help you.
Please remember that you need the Cloud Storage API and not the GAE API (just FYI :) . You can read about that API here -> https://developers.google.com/storage/docs/json_api/v1/json-api-java-samples (JSON, there is also a XML API)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With