Using GoogleFile object without GoogleFileService

6 views
Skip to first unread message

Max

unread,
Jul 3, 2010, 9:03:18 PM7/3/10
to GoogleFileService
Hi,

I have an application that receives emails into GAE, strips the email
contents, and attachment contents. I'd like to save the attachment in
original form as a GoogleFile. My thought is to just have an
attribute of GoogleFile, set with my JDO object, and persist it.
However, I'm not sure if I should use the DatastoreUtils class since
there's support for saving already there. If I use the static method,
how do I associate it with my JDO object. If I not use DatastoreUtils
and use GoogleFile directly. If so, is there any sample code or
direction that you can help me with?

thanks!
Max

tytung

unread,
Jul 4, 2010, 3:43:24 AM7/4/10
to GoogleFileService
Hi, Max

http://code.google.com/p/google-file-service/source/browse/tags/GoogleFileService-v0.3/src/sinica/googlefileservice/client/examples/MyFileServiceClient.java
MyFileServiceClient.java remotely uploads and saves the email
attachment as a GoogleFile.
Maybe you can modify it to work locally within GAE by using the method
DatastoreUtils.insertGoogleFile.

BTW, DatastoreUtils is recommended to you if your attachment is over
1MB.
DatastoreUtils will seperate a large file to GoogleUnit automatically.
This feature is why I wrote the GoogleFileService and the related APIs
and data models.

tytung
Reply all
Reply to author
Forward
0 new messages