Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 9612 invoked from network); 12 Jun 2002 17:35:27 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jun 2002 17:35:27 -0000 Received: (qmail 3135 invoked by uid 97); 12 Jun 2002 17:35:24 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 3050 invoked by uid 97); 12 Jun 2002 17:35:23 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 2981 invoked by uid 98); 12 Jun 2002 17:35:23 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) From: "Gunnlaugur Thor Briem" To: "Jakarta Commons Developers List" Subject: RE: [HttpClient] REPOST: Handlers for HttpClient? Date: Wed, 12 Jun 2002 17:35:16 -0000 Message-ID: MIME-Version: 1.0 In-Reply-To: <1023902007.1367.230.camel@localhost.localdomain> Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > That would probably mean that we would need to create implementations > for java.net.URL, java.net.HttpURLConnection and maybe also for > java.net.URLConnection. URL is a final class, so I don't know how it > would be possible to get it to return something different with > URL.openConnection(). >=20 > Do you think it would be possible? To control what URL returns from url.openConnection, you can either install a URLStreamHandlerFactory using the method URL.setURLStreamHandlerFactory(URLStreamHandlerFactory fac), see http://java.sun.com/j2se/1.3/docs/api/java/net/URL.html, or (less drastically) control the behavior of the default URLStreamHandlerFactory implementation: define your handlers with a particular naming convention and list their packages in the system property java.protocol.handler.pkgs. See this: http://developer.java.sun.com/developer/onlineTraining/protocolhandlers/ for enough details to work with. Both approaches unfortunately require tweaking the global configuration of the JVM, which may be annoying to those working in servlet/J2EE environments, but that's a problem you're always stuck with when using the URLConnection scheme -- it can only be configured globally in the JVM. Hope that helps, - Gulli > -----Original Message----- > From: Evert Hoff [mailto:evert.hoff@pixie.co.za] > Sent: 12. j=FAn=ED 2002 17:13 > To: Jakarta Commons Developers List > Subject: Re: [HttpClient] REPOST: Handlers for HttpClient? >=20 >=20 > Hi Matt, >=20 > That would probably mean that we would need to create implementations > for java.net.URL, java.net.HttpURLConnection and maybe also for > java.net.URLConnection. URL is a final class, so I don't know how it > would be possible to get it to return something different with > URL.openConnection(). >=20 > Do you think it would be possible? >=20 > Evert >=20 > On Wed, 2002-06-12 at 18:27, SkyLeach wrote: > > Nobody responded to this last time, and I still am interested in = knowing the > > answer. Please read if you are using HttpClient and let me know... > >=20 > > thanks, > >=20 > > ----- Original Message ----- > > From: "Matt Gregory" > > To: > > Sent: Tuesday, June 11, 2002 11:39 AM > > Subject: Handlers for HttpClient? > >=20 > >=20 > > > Have handler classes been created to wrap the Commons project = HttpClient? > > > > > > In other words, can I pass the > > > "-Djava.protocol.handler.pkgs=3Dorg.apache.commons.httpclient" = directive to > > my > > > JVM and expect to get an = org.apache.commons.httpclient.HttpConnection back > > > from a java.net.URL.openConnection() call when I specify the = "http" > > protocol? > > > > > > Please let me know, and if not then I will work to extend the = package now. > > > I must have this functionality ASAP because my package, = PortletStreams is > > in > > > production but needs cookie handling and HTTP authentication. > > > > > > Thanks in advance... > > > -Matt > > > > > > > > > -- > > > To unsubscribe, e-mail: > > > > > For additional commands, e-mail: > > > > > > > > > >=20 > >=20 > > -- > > To unsubscribe, e-mail: = > > For additional commands, e-mail: = > >=20 >=20 >=20 >=20 >=20 > -- > To unsubscribe, e-mail: = > For additional commands, e-mail: = >=20 -- To unsubscribe, e-mail: For additional commands, e-mail: