I have a function that retrieves a download link for an object stored in the Google Cloud Storage. The implementation in Java looks something like this:
public String getDownloadLink(String bucketName,
String blobName) {
return storage.signUrl(
BlobInfo.newBuilder(bucketName, blobName).build(),
60,
TimeUnit.MINUTES,
SignUrlOption.httpMethod(HttpMethod.GET),
SignUrlOption.withV4Signature()
).toString();
}
The above method takes the bucketName and blobName as arguments and returns a downloadlink for that object, valid for 60 minutes. Is it possible to get a list of downloadlink for multiple files or objects in the same bucket, using Java client api for GCS, without having to call the above function in a for-loop? For example the above method could look something like :
public List<String> getDownloadLink(String bucketName,
List<String> blobName) {
// Get the downloadlinks for all the blobName in the list
}
I've been looking around for a solution, but couldn't find anything substantial, and been resorting to using a for-loop to get downloadlinks for multiple filenames. Using for-loop to query multiple files could get pretty resource consuming and tedious. Could really use some help.