java.net.URL Question

Discussion in 'Java' started by Lee H, Sep 9, 2004.

  1. Lee H

    Lee H Guest

    Hi,
    Is there an easy way of verifying that a given string is a valid URL/URI
    (In other words, that it is according to the syntax specified in
    rfc2396. I don't mean to check if the resource exists, or even if the
    host exist, just that it is syntactically valid).

    (Constructors of java.net.URL throw MalformedURLException only if the
    protocol is unknown).
     
    Lee H, Sep 9, 2004
    #1
    1. Advertisements

  2. Lee H

    Real Gagnon Guest

    > Is there an easy way of verifying that a given string is a valid URL/URI
    > (In other words, that it is according to the syntax specified in
    > rfc2396. I don't mean to check if the resource exists, or even if the
    > host exist, just that it is syntactically valid).


    See (long url)
    <http://jakarta.apache.org/commons/validator/xref/org/apache/commons/validator/UrlValidator.html>

    Bye
    --
    Real Gagnon from Quebec, Canada
    * Looking for Java or PB snippets ? Visit Real's How-to
    * http://www.rgagnon.com/howto.html
     
    Real Gagnon, Sep 9, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jon paugh
    Replies:
    1
    Views:
    1,356
  2. anonymous
    Replies:
    1
    Views:
    4,901
    Francisco Padron
    May 8, 2005
  3. Sergei
    Replies:
    0
    Views:
    524
    Sergei
    Nov 29, 2003
  4. Andrew Thompson

    java.net.URL

    Andrew Thompson, Jun 19, 2005, in forum: Java
    Replies:
    8
    Views:
    880
  5. Stanimir Stamenkov
    Replies:
    1
    Views:
    2,941
    Stanimir Stamenkov
    Aug 17, 2005
  6. Alun Harford
    Replies:
    0
    Views:
    2,361
    Alun Harford
    Oct 31, 2005
  7. Replies:
    0
    Views:
    630
  8. Just D.
    Replies:
    0
    Views:
    815
    Just D.
    Aug 11, 2004
Loading...