3 messages in com.googlegroups.google-base-data-apiRe: Get Content with Java
FromSent OnAttachments
kentusha10 May 2007 08:16 
Lane LiaBraaten (Google)10 May 2007 10:44 
kentusha11 May 2007 07:29 
Subject:Re: Get Content with Java
From:kentusha (kent@gmail.com)
Date:05/11/2007 07:29:22 AM
List:com.googlegroups.google-base-data-api

lovely thanks that did the trick!

On 10 Mai, 19:44, "Lane LiaBraaten (Google)" <api.@gmail.com> wrote:

Hi kentusha,

You've almost got it...you just need to cast the element's content to a TextContent object. Then you can get the text from there like this:

TextContent content = (TextContent) element.getContent(); String text = content.getContent().getPlainText();

The Content object has several subclasses so that the client library can handle text, media or other types of content. It adds a bit of complexity to the code shown here, but allows for the library to handle content like pictures and video.

Hope that helps, Lane

On May 10, 8:16 am, kentusha <kent@gmail.com> wrote:

I am trying to access the content of a query. However the the Content object has no methods for example getContent(). What does one need to do? The toString() doesnt return anything useful

Here is basically what I am doing:

GoogleBaseFeed feed = service.query(query); LinkedList list = (LinkedList) feed.getEntries();

for (Iterator iter = list.iterator(); iter.hasNext();) { GoogleBaseEntry element = (GoogleBaseEntry) iter.next(); Content content = element.getContent(); }

thanks