google app engine - How to access file present inside bucket of another application -
i trying read .txt file present inside bucket of google application.
below code
gcsinputchannel readchannel = null; bufferedreader reader = null; gcsfilename filename = new gcsfilename("abc.appspot.com","for_prod_scripts.txt"); gcsservice gcsservice = gcsservicefactory.creategcsservice(); // can read file through api: readchannel = gcsservice.openreadchannel(filename,0); // again, different standard java ways of reading channel. reader = new bufferedreader(channels.newreader(readchannel, "utf8")); //csvreader csvreader = new csvreader(reader); string line = reader.readline(); while ((line = reader.readline()) != null) { log.warning("read:" + line); }
i have added below permissions bucket permissions , object default permissions of bucket.as shown in below image. 123412341234 application's project id. inside accessing bucket
i getting below exception
java.lang.runtimeexception: com.google.appengine.tools.cloudstorage.simplegcsinputchannelimpl$1@1f75e55: unexpected cause of executionexception
am missing here?
need add service account email bucket permissions accessing files inside buckets.
Comments
Post a Comment