Febian Shah
Febian Shah

Reputation: 1007

Bigquery Java API - Get sublisting within a cloud folder?

How do I get a list of objects within a sub-directory on cloud storage using the Bigquery Java api?

I can get a list of objects within a folder but not within a second level folder. So if I have /Folder1/Folder2/File1.csv /Folder1/File2.csv

I can get Folder2 & File2.csv using the following command:

list = cloudstorage.objects().list("Folder1");

But how do I get the list of objects within Folder2?

Upvotes: 0

Views: 59

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 173028

I think - you should use setPrefix method to filter results to objects whose names begin with this prefix. Assuming your bucket is Folder1, you should try

setPrefix("Folder2/")

Upvotes: 1

Related Questions