You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Florian Fray <fr...@itcf.biz> on 2007/04/19 05:53:06 UTC

J2SE Integration

Hi,

I was wondering if integrating the HttpClient into the J2SE more 
seamlessly would be of interest for other people as well!?

The idea is enabling the java.net.URL.openConnection() returning a 
bridge to the HTTP-Client.

For quick tasks Suns implementation is okay, but you know best that 
there's need for a full-blown HTTP-Client, right :)

I've searched around for such an implementation, but didn't find 
anything publicly available.

So far, I've implemented a prototype, so all I need is some info on
- if it's of interest
- a brief intro on your conventions for Code, Tests, Docs, contributing, ...

Best regards,

Florian Fray

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: J2SE Integration

Posted by Florian Fray <fr...@itcf.biz>.
Hi Ortwin,

this o.a.c.h.u.HttpURLConnection is requiring putting in an executed 
HttpMethod for instantiation, but in principle this is what I want to do.
In the end the aim is to be able to do the following:
HttpURLConnection con = new 
java.net.URL("http://foo.bar.com").openConnection(); and receiving a 
Bridge to the Jakarta HttpClient and not to the Sun-ones.
This is already working, just by setting a System-property and pointing 
to a package containing a Factory.

The reason for doing this is simple: I've received some Code making use 
of the standard URLConnection.
When using this it turned out that I need more control forcing the use 
of HTTP/1.0 and/or closing the Connection properly. AFAIK this is not 
possible, so I would have to modify the scripts.
So I've searched for a way for not having to step through every class 
(it's a bunch of them each handling the Connection ... bad style, but 
they're intended for some testing purposes only) and touch all these.

My current Implementation works fine so far, but there's still some 
things needed to be done, so I'm not finished (cleaning up the code, 
documenting it, removing JDK1.5 language features, ...).


Best regards,

Florian

Ortwin Glück schrieb:
> 
> Florian Fray wrote:
>> Hi,
>>
>> I was wondering if integrating the HttpClient into the J2SE more
>> seamlessly would be of interest for other people as well!?
>>
>> The idea is enabling the java.net.URL.openConnection() returning a
>> bridge to the HTTP-Client.
>>
>> For quick tasks Suns implementation is okay, but you know best that
>> there's need for a full-blown HTTP-Client, right :)
>>
>> I've searched around for such an implementation, but didn't find
>> anything publicly available.
> 
> Florian,
> 
> There is already something like that in the stock HttpClient implementation:
> 
> org.apache.commons.httpclient.util.HttpURLConnection
> 
> Is that what you had in mind?
> 
> Ortwin
> 
>> So far, I've implemented a prototype, so all I need is some info on
>> - if it's of interest
>> - a brief intro on your conventions for Code, Tests, Docs, contributing,
>> ...
>>
>> Best regards,
>>
>> Florian Fray
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: J2SE Integration

Posted by Ortwin Glück <od...@odi.ch>.

Florian Fray wrote:
> Hi,
> 
> I was wondering if integrating the HttpClient into the J2SE more
> seamlessly would be of interest for other people as well!?
> 
> The idea is enabling the java.net.URL.openConnection() returning a
> bridge to the HTTP-Client.
> 
> For quick tasks Suns implementation is okay, but you know best that
> there's need for a full-blown HTTP-Client, right :)
> 
> I've searched around for such an implementation, but didn't find
> anything publicly available.

Florian,

There is already something like that in the stock HttpClient implementation:

org.apache.commons.httpclient.util.HttpURLConnection

Is that what you had in mind?

Ortwin

> So far, I've implemented a prototype, so all I need is some info on
> - if it's of interest
> - a brief intro on your conventions for Code, Tests, Docs, contributing,
> ...
> 
> Best regards,
> 
> Florian Fray

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: J2SE Integration

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2007-04-19 at 05:53 +0200, Florian Fray wrote:
> Hi,
> 
> I was wondering if integrating the HttpClient into the J2SE more 
> seamlessly would be of interest for other people as well!?
> 
> The idea is enabling the java.net.URL.openConnection() returning a 
> bridge to the HTTP-Client.
> 
> For quick tasks Suns implementation is okay, but you know best that 
> there's need for a full-blown HTTP-Client, right :)
> 
> I've searched around for such an implementation, but didn't find 
> anything publicly available.
> 

Hi Florian

I _personally_ am not sure there is a lot of practical value in
HttpURLConnection adapter for HttpClient. The whole point of using
HttpClient is to be able to make use of its more flexible API. If the
URLConnection API works for you, you might as well use the default HTTP
implementation shipped with your JRE of choice. 

Having said all that, I want to assure you we'll happily take this code
as a contribution to the project.

> So far, I've implemented a prototype, so all I need is some info on
> - if it's of interest
> - a brief intro on your conventions for Code, Tests, Docs, contributing, ...
> 

We are pretty liberal about the code we accept to the semi-official
'contrib' package. Just open a Jira issue and attach the code to it once
it is ready for the first round of reviews.

Oleg

> Best regards,
> 
> Florian Fray
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org