0
votes

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?

1
this doesn't seem like a 'bigquery' question?Felipe Hoffa
@FelipeHoffa My bad, I added that I'm using the Bigquery Java APIFebian Shah
still not bigquery, I think you want the [google-cloud-storage] tagFelipe Hoffa
I think you should use setPrefix method to filter results to objects whose names begin with this prefix. and Yes, this is not BigQuery but rather Cloud Storage JSON Java APIMikhail Berlyant
Assuming your bucket is Folder1 i think the value to pass there - will be "Folder2/"Mikhail Berlyant

1 Answers

1
votes

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/")