You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by Gu...@McAfee.com on 2011/12/09 13:20:11 UTC

Entry-Content with mime type application/xml as stream.

Hi, if got a little "problem".
I have got a post request to create new resources.
The Post Request contain an antry element:
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app">
  <description/>
                <content type="application/xml">
                <some xstream xml>...< some xstream xml >
                .... more
                </content>
</entry>

What I would like to do is getting the content of the content tag either as a  stream/streamreader.
I don't want to use the Entry.getContent() because the embedded xml elements can be very long and I want to save memory on the serverside.

Furhter information:
I want to use XStream to create java objects  out of the entry content.
I want to avoid reading the content into a string  first.

Any ideas / Hints.

I hope I could make myself clear and my question is understandable :(


________________________________
Firmensitz: Muenchen
Amtsgericht: AG Muenchen
Handelsregister: HRB 144340
Geschaeftsfuehrer: Emmet Russell, Keith Krzeminski, Douglas Rice
Bankverbindung: ABN-Amro Bank N.V. Konto 671 211 9006
UST-ID: DE168122444

Re: Entry-Content with mime type application/xml as stream.

Posted by James Snell <ja...@gmail.com>.
Because of the way the entry is parsed, there's no way to get xml
content as a stream. If you absolutely need that model and if you have
control over the feed construction, the best bet is to use <content
type="application/xml" src="http://..." /> where the src points to a
URL where the xml can be retrieved. Otherwise, there's not much you're
going to be able to do here.

On Fri, Dec 9, 2011 at 4:20 AM,  <Gu...@mcafee.com> wrote:
> Hi, if got a little "problem".
> I have got a post request to create new resources.
> The Post Request contain an antry element:
> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app">
>  <description/>
>                <content type="application/xml">
>                <some xstream xml>...< some xstream xml >
>                .... more
>                </content>
> </entry>
>
> What I would like to do is getting the content of the content tag either as a  stream/streamreader.
> I don't want to use the Entry.getContent() because the embedded xml elements can be very long and I want to save memory on the serverside.
>
> Furhter information:
> I want to use XStream to create java objects  out of the entry content.
> I want to avoid reading the content into a string  first.
>
> Any ideas / Hints.
>
> I hope I could make myself clear and my question is understandable :(
>
>
> ________________________________
> Firmensitz: Muenchen
> Amtsgericht: AG Muenchen
> Handelsregister: HRB 144340
> Geschaeftsfuehrer: Emmet Russell, Keith Krzeminski, Douglas Rice
> Bankverbindung: ABN-Amro Bank N.V. Konto 671 211 9006
> UST-ID: DE168122444