2013年1月18日金曜日

Google Cloud Storageのドキュメント - Java API概要 その10

Google Cloud StorageのJava APIの概要についての
ドキュメントを翻訳しています。

翻訳元はこちらです。

このドキュメントは、Google App Engineアプリケーションから
Google Cloud Storageの機能を呼び出す方法について
説明しています。

現在は試験的運用中なので、今後変更があるかもしれません。

第1回はこちら、第2回はこちら、第3回はこちら
第4回はこちら、第5回はこちら、第6回はこちら
第7回はこちら、第8回はこちら、第9回はこちらです。

Reading the Object - オブジェクトの読み出し

オブジェクトを読み出す前に、オブジェクトのファイナライズを行わなければなりません。 オブジェクトを読み出すには:
boolean lockForRead = false;
String filename = "/gs/my_bucket/my_object";
AppEngineFile readableFile = new AppEngineFile(filename);
FileReadChannel readChannel = fileService.openReadChannel(readableFile, lockForRead);

// Read the file in whichever way you'd like
BufferedReader reader = new BufferedReader(Channels.newReader(readChannel, "UTF8"));
String line = reader.readLine();
resp.getWriter().println("READ:" + line);

readChannel.close();
一つのAPIコールでアプリケーションによって読み出されるオブジェクトの最大サイズは、32メガバイトです。

インストール不要・無料のKaede翻訳ツール:
http://kaedetrans-hrd.appspot.com/

0 件のコメント:

コメントを投稿