commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Davis, Caleb" <>
Subject [httpclient] Why no HttpUrlMethodBase?
Date Tue, 05 Mar 2002 14:52:40 GMT
I've noticed that there's a set of methods now in httpclient called
'Url<METHODNAME>Method', which seem to implement HttpMultiClient compatible

These seem to all have the same boilerplate code in them for setting and
getting the url, and passing on the path information to the super class.

>From the perspective of someone who might be implementing several new
UrlMethods, I'm thinking about a new abstract class as an analog to the
HttpClient's HttpMethodBase - the HttpUrlMethodBase. It might look something
like this:

	package org.apache.commons.httpclient;


	public abstract class HttpUrlMethodBase
		extends HttpMethodBase
		implements HttpUrlMethod {

		private URL _url;
		public HttpUrlMethodBase() {

		public HttpUrlMethodBase(String url) throws
MalformedURLException {		
			_url = new URL(url);

		public void setUrl(String url) throws MalformedURLException
			_url = new URL(url);

		public String getUrl() {
			return _url.toExternalForm();

		public abstract String getName();

A new HttpUrlMethod would only have extend HttpUrlMethodBase and override
getName, to be functional, in the same fashion as a new HttpMethod only has
to extend HttpMethodBase and override getName. Does this sound reasonable
and/or useful to anyone but myself?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message