On Tue, 2009-09-08 at 09:59 +0200, Javier Puerto wrote:
> Hi,
Hi Javier,
I included Oleg in cc since he knows about your final question.
> Working with a crawler I need to post the response (xml) to an Apache Solr
> and found problems to do it because the class HttpContentEntity don't give
> me enougth freedom.
>
> Creating a HttpEntity to post by a Handler . I tried three forms:
>
> * final ByteArrayEntity entityHttp = new
> ByteArrayEntity(IOUtils.toByteArray(entity.getContents())); //Have to read
> all the bytes and store in a byte array.
>
> * final InputStreamEntity entityHttp = new
> InputStreamEntity(entity.getContents(), LENGTH); //I like this form, but I
> don't have the content length.
>
> * Modify the HttpContentEntity class so i could get the raw entity. //This
> is the more comfortable and flexible manner.
>
> public HttpEntity getRawEntity() {
> return this.entity;
> }
>
>
> What do you think? Does it make sense to change the HttpContentEntity class
> and add the above method?
>
I see your point and if there is no good reason to not expose the entity
I say go ahead and create a patch.
> Or are there are some reasons to not expose the HttpEntity like that?
Oleg, wdyt?
salu2
> If not I will prepare a patch.
>
> Salu2.
--
Thorsten Scherler <thorsten.at.apache.org>
Open Source <consulting, training and solutions>
|