Yeah, I got that bro! My code was as follows:
MediaContent content = (MediaContent)entry.getContent();
URL docUrl = new URL(content.getUri());
byte bytes[] = new
byte[docUrl.openStream().available()];
docUrl.openStream().read(bytes);
System.out.println(new String(bytes));
The byte array was
<HTML>
<HEAD>
<TITLE>Moved Temporarily</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Moved Temporarily</H1>
The document has moved <A HREF="
https://www.google.com/accounts/ServiceLogin?service=writely&passive=true&nui=1&continue=http%3A%2F%2Fdocs.google.com%2Ffeeds%2Fdownload%2Fdocuments%2FRawDocContents%3Faction%3Dfetch%26justBody%3Dfalse%26revision%3D_latest%26editMode%3Dfalse%26docID%3Ddctkpmtq_34cfgt54fn&followup=http%3A%2F%2Fdocs.google.com%2Ffeeds%2Fdownload%2Fdocuments%2FRawDocContents%3Faction%3Dfetch%26justBody%3Dfalse%26revision%3D_latest%26editMode%3Dfalse%26docID%3Ddctkpmtq_34cfgt54fn&ltmpl=homepage&rm=false
">here</A>.
</BODY>
</HTML>
Peace,
Scott
On Tue, Jan 6, 2009 at 12:21 PM, Eric (Google) <[email protected]> wrote:
>
> The API is mainly for document management, but developers
> needs/wants will drive feature requests. Also, I may have been
> unclear...
>
> You _can_ use the API to read the contents of documents. My example
> doesn't show how to do that. It only shows finding the necessary URL.
> Just perform an HTTP GET on that URL and you're in business.
>
> Reading the contents isn't built directly into the Java client lib b/c
> of issue 35.
>
> Eric
>
> On Jan 6, 5:13 am, [email protected] wrote:
> > Thanks Eric --
> >
> > Can you tell me what the value is in using the list API if the client
> must
> > use the document URI to actually read the content? I must be missing
> > something more essential here.
> >
> > Peace,
> > Scott
> >
> > On Tue, Jan 6, 2009 at 12:03 AM, Eric (Google) <[email protected]>
> wrote:
> >
> > > I've posted a tip on the gdata tips blog:
> >
> > >http://gdatatips.blogspot.com/2009/01/retrieve-documents-content-in-j.
> ..
> >
> > > If you haven't seen in the forums, there's an outstanding feature
> > > request for retrieving a doc's contents from an authenticated request:
> > >http://code.google.com/p/gdata-issues/issues/detail?id=35
> >
> > > Right now, I believe the doc has to be published.
> >
> > > Eric
> >
> > > On Jan 4, 4:32 pm, stanlick <[email protected]> wrote:
> > > > Greetings --
> >
> > > > I downloaded the client jars today and have the code running to
> > > > generate a list of my docs. In the loop I see the object type is a
> > > > com.google.gdata.data.docs.DocumentListEntry. My question is how to
> > > > read the contents of a document?
> >
> > > > What I am trying to do is stream the contents of a shared file into a
> > > > region of a web page. In other words, I want to allow web content to
> > > > be made available from a a shared document.
> >
> > > > Peace,
> > > > Scott
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Docs Data APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---