As of now, im using the signed url technique to get the files from GCS
BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of(bucketName, gcsFolderPrefix + fullFileName)).build();
URL url = storage.signUrl(blobInfo, 15, TimeUnit.MINUTES,Storage.SignUrlOption.withV4Signature());
After hitting the generated signed url in the browser , its getting downloaded but I need to open the file,I tried by adding the response headers also like below:
response.addHeader(HttpHeaders.CONTENT_TYPE, "multipart/form-data");
response.addHeader(HttpHeaders.CONTENT_DISPOSITION,"inline;filename=" + fileId.toString()+".pdf");