Code example for JarEntry

Methods: getName

0
		return createUrl(jarFile, jarEntry, new File(jarFile.getName()).toURI().toURL());
	} 
 
	public static URL createUrl(JarFile jarFile, JarEntry jarEntry, URL codeSource) throws MalformedURLException {
		JarFileUrlStreamHandler handler = new JarFileUrlStreamHandler(jarFile, jarEntry);
		URL url = new URL("jar", "", -1, codeSource + "!/" + jarEntry.getName(), handler);
		handler.setExpectedUrl(url);
		return url;
	} 
 
	private URL expectedUrl;
	private final JarFile jarFile;
	private final JarEntry jarEntry;
 
	public JarFileUrlStreamHandler(JarFile jarFile, JarEntry jarEntry) {
		if (jarFile == null) {
			throw new IllegalArgumentException("Illegal null jarFile specified for JarFileUrlStreamHandler");
		} 
		if (jarEntry == null) {
			throw new IllegalArgumentException("Illegal null jarEntry specified for JarFileUrlStreamHandler");