Manish Parab
Manish Parab

Reputation: 87

Reading files from google cloud storage bucket

I'm using spring boot to connect to google cloud storage.

I'm able to connect to a single file and read the contents from google cloud storage bucket.

but I'm not able to get list of all the files in google cloud storage bucket.

please help me.

This works

Resource gcsFile = this.context.getResource("gs://" + bucketName + "/" + filePath);

This does not work.

 Resource[] resources = this.context.getResources("gs://" + bucketName + "/*.*");

any reasons ?

Upvotes: 0

Views: 1630

Answers (1)

MrTech
MrTech

Reputation: 438

I've found a document here with sample code that can help you. Take a look and tell me if this helps.

This page shows you how to list the objects stored in your Cloud Storage buckets, which are ordered in the list lexicographically by name.

Upvotes: 1

Related Questions