incubator-droids-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Puerto <jpue...@gmail.com>
Subject Raw content on HttpContentEntity
Date Tue, 08 Sep 2009 07:59:12 GMT
Hi,

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?

Or are there are some reasons to not expose the HttpEntity like that?

If not I will prepare a patch.

Salu2.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message