0
votes

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 ?

1
Do you see an Error message when your app runs those lines? Or you don't see any result at all?Kevin Quinzel
malformed uri is the exceptionManish Parab

1 Answers

1
votes

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.