Code example for URI

Methods: getSchemetoASCIIString

0
		// encoding the whole URL means that you get URLs that look like 
		// http%3C%2F%2Fmydomain%2Fblah%2Fblah%2Fblah.html 
		// This is not what we want. The most likely error will be not 
		// encoding spaces, so convert + and space to %20 
 
		URI testUri = new URI(despacedUrl);
		// URL testUrl = new URL(url); 
 
		if (testUri.getScheme() == null) {
			throw new URISyntaxException(url, NLS.bind("URL {0} has no protocol", url));
		} 
		this.urlString = testUri.toASCIIString();
 
	} 
 
	public String getName() {
 
		try { 
			return URLDecoder.decode(urlEncodedName, "UTF-8");
		}