Hey, I understand what you meant.
You mean URL encoding, like " " = %20. A URLBuilder would be a good way to describe what you want. Sorry, but I don't know any like this. I can't be difficult to make it yourself though. Supplying a basic and splitting it with a tokenizer, and then building it on toString(). To encode the URL you can use java.net.URLEncoder.encode(String s) to encode the parts. Q On 6/21/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Quintin, > > Thanks for your answer. My answer/querstions are inlined. > > Besides the parameters added to your url "lang=" and "country=" isn't a >> standard. That is just options used by google. There isn't even a >> guarentee >> that any other sites in the world support them. >> > > the example with google is not representative and the idea would of course > to be as generic as possible. For example, the addParameter method not > called add<Key>Parameter(String value) but addParameter(String key, String > value). > > one could imagine having methods for other types (addBooleanParameter, > addIntParameter) or add methods similar to the one found in the commons-lang > library (setDefautltParameter(String key, String value) would only add the > parameter if the value is not blank, for example). > > Since this class is more of a UrlBuilder nature, java.net.URL doesn't fit > very well (IIRC there's an enhancement request in the Sun bug database). > > Encoding is usually passed through headers, >> and therefore is related to the request object. >> > > I was thinking of the replacement of spaces in the query string. > > If you want to do it like you asked though, create a URL delegate class. >> Basically just a class that manages the URL and you expose methods like >> the >> ones you mentioned. >> > > Of course this is one option. I was just hoping that -since it's a common > problem- I would be able to find a common solution. > > I can always try to write such a class using HttpCore components (e.g. > HttpParams) and contribute it back to the project. > > Regards, > > -Vladimir > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Quintin Beukes