Code example for URI

Methods: toURL

0
	public static void addURIToClasspath(URI uri)
	{ 
		try 
		{ 
			URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
			URL url = uri.toURL();
			Class<?> urlClass = URLClassLoader.class;
			Method method = urlClass.getDeclaredMethod("addURL", new Class<?>[] { URL.class });
			method.setAccessible(true);
			method.invoke(urlClassLoader, new Object[] { url });
		} 
		catch (Throwable t)
		{ 
			t.printStackTrace();
		} 
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java