reading file from google cloud storage

33 visibility 0 arrow_circle_up 0 arrow_circle_down

Using cloud Code i have created keys and added them in the Env. Now i am trying to read the bucket but it is not allowing me the read the content.

I am getting the below exception Could not open ServletContext resource [/gs://mybucket/my-file.txt]

 public class Controller {

private Resource gcsFile;

@RequestMapping(value = "/readgcs", method = RequestMethod.GET)
public String readGcsFile() throws IOException {
    return StreamUtils.copyToString(
            Charset.defaultCharset()) + "\n";