Saturday, September 10, 2011

This is a test post to see how it'll look

Google's Data API (gdata) makes accessing their suite of tools and sites a lot easier than making direct HTTP calls to the Web-based service interfaces. But there don't seem to be too many code snippets out there--or at least not enough that do what I want to do. I have a document that was uploaded through a Servlet and is now sitting in a byte[] array. Now I want to upload that file to my app's Google Docs account. Here's what Google's documentation offers: Fairly straightforward, but there's one catch: The setFile() method is expecting a Normally that isn't a problem, but if you're developing in Google App Engine (GAE), then you know that you can't create filesystem files. Digging through the DocumentListEntry code (thank you, Google, for making gdata open source!!) I was able to figure out how to avoid this File creation entirely: