CreateURL

try {
    // With components.
    URL url = new URL("http", "hostname", 80, "index.html");

    // With a single string.
    url = new URL("http://hostname:80/index.html");
} catch (MalformedURLException e) {
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.