Friday, March 15, 2013

Google Cloud Storage IOException

I am getting an ExpectedException trying to read from Google Cloud Storage. Please help!

This is the function that I am using to read my file.

public String importData() {

String result = "Done reading file.";
boolean lockForRead = false;
String filename = "/gs/maple/save.txt";
try {
// Get the file
FileService fileService = FileServiceFactory.getFileService();
AppEngineFile readableFile = new AppEngineFile(filename);
FileReadChannel readChannel = fileService.openReadChannel(readableFile, lockForRead);

// Read the file
BufferedReader reader = new BufferedReader(Channels.newReader(readChannel, "UTF8"));
String line = reader.readLine();
System.out.println("line = " + line);
readChannel.close();
}
catch (IOException e) {
result = "Failed to read file";
e.printStackTrace();
}
return result;
}

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate