hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <erwin.verv...@fortisbank.com>
Subject convert java.net.URL to something HttpClient can use
Date Tue, 25 Nov 2003 12:26:48 GMT
Hello,

Is there an easy way to convert a java.net.URL to something HttpClient can use, with appropriate
encoding?

I'm now using:

		URL url=...;
		String path=url.getPath()==null ? url.getPath() : URIUtil.encodePath(url.getPath());
		String query=url.getQuery()==null ? url.getQuery() : URIUtil.encodeQuery(url.getQuery());
		return new URI(
			url.getProtocol(),
			url.getUserInfo(),
			url.getHost(),
			url.getPort(),
			path,
			query,
			url.getRef())
				.toString();


Erwin Vervaet




= = = = = = = = = = = = = = = = = = = = = = = = =
Fortis Bank disclaimer :
http://www.fortisbank.be/legal/disclaimer.htm

Fortis Bank privacy policy :
http://www.fortisbank.be/legal/privacy_policy.htm
= = = = = = = = = = = = = = = = = = = = = = = = =




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


Mime
View raw message