如何在java中逐行读取存储在GAE的blobstore上的文件?

时间:2012-06-22 07:52:25

标签: java google-app-engine

我使用以下链接中给出的代码在blobstore上上传文件 https://developers.google.com/appengine/docs/java/blobstore/overview#Writing_Files_to_the_Blobstore

1 个答案:

答案 0 :(得分:1)

您发布的链接中提供的示例有什么问题?

 // Later, read from the file using the file API
      lock = false; // Let other people read at the same time
      FileReadChannel readChannel = fileService.openReadChannel(file, false);

  // Again, different standard Java ways of reading from the channel.
      BufferedReader reader = new BufferedReader(Channels.newReader(readChannel, "UTF8"));
      String line = reader.readLine();
  // line = "The woods are lovely dark and deep."