Hey,

What is wrong with java.net.URL?

URL u = new URL("http://www.google.com";);
u.getHost();
u.getFile();
u.getPath();
u.getProtocol();
u.getQuery();
u.getRef();

Not sure you can check the encoding, but it would probably match the
encoding used by all your string objects.

Q

On 6/21/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I feel kind of stupid to ask such a simple question but I couldn't find the
> right library to do this simple job (and even asking around didn't return
> much valuable information).
>
> I would like to provide a handy way to (only) create a string URL
> definition, manage the parameters and handle the encoding.  Something like:
>
>  URLDefinition def = new URLDefinition("http://google.com";);
>  def.addParameter("lang", "de");
>  def.addParameter("country", "ch");
>  String a = def.toString();
>
> and a is magically "http://google.com?lang=de&country=ch"; :-)
>
> I haven't seen anything ready-to-use in the various commons libraries
> (HttpParams is the closest I could find).  Is there anything out there that
> I've been missing or should I simply roll my own version?
>
> Best regards,
>
> -Vladimir
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Quintin Beukes

Reply via email to