Hello

We had a code used to write to google data store from our appengine app for
java and now it fails with some IOException. Please help as this is a key
functionality

E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore:
Exception in finally of execute of writeToGoogleStore
E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore:
Exception class is :java.io.IOException
E 2012-09-19 21:59:13.603
vik.sakshum.sakshumweb.server.common.CommonServiceCode writeToGoogleStore:
Exception is :null


The code which is broken now is

try {
 log.info("Starting google storage");
 // Get the file service
FileService fileService = FileServiceFactory.getFileService();
 GSFileOptionsBuilder optionsBuilder = new GSFileOptionsBuilder()
.setBucket(bucketName).setKey(key).setAcl("public-read")
 .setMimeType("text/html");

// Create your object
 AppEngineFile writableFile = fileService
.createNewGSFile(optionsBuilder.build());

// Open a channel for writing
boolean lockForWrite = true;
 FileWriteChannel writeChannel = fileService.openWriteChannel(
writableFile, lockForWrite);
 PrintWriter out = new PrintWriter(Channels.newWriter(writeChannel,
"UTF8"));
 out.println(emailMsgTxt);
out.close();
writeChannel.closeFinally();
 } catch (Exception e) {
e.printStackTrace();
log.severe("Exception in finally of execute of writeToGoogleStore");
 log.severe("Exception class is :" + e.getClass().getName());
log.severe("Exception is :" + e.getMessage());
 return "failed";
}



Thankx and Regards

Vik
Founder
http://www.sakshum.org
http://blog.sakshum.org

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to