package com.mindprod.example;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Encode a URL using RFC 2396.
* <p/>
* composed with IntelliJ IDEA
*
* @author Roedy Green, Canadian Mind Products
* @version 1.0, 2006-03-02
*/
public final class TestURLEncode
{
/**
* Test URL encode via URI to URL.
*
* @param args not used
* @throws MalformedURLException if test URL illegal.
* @throws URISyntaxException if URL mangled.
*/
public static void main( String[] args ) throws URISyntaxException, MalformedURLException
{
URI uri = new URI( "http", "//www.example.com/you & I 10%? weird & weirder neé", null );
System.out.println( uri.toURL().toString() );
}
}