edu.emory.mathcs.util.classloader.jar
Class JarURLStreamHandler

java.lang.Object
  extended byjava.net.URLStreamHandler
      extended byedu.emory.mathcs.util.classloader.jar.JarURLStreamHandler

public class JarURLStreamHandler
extends java.net.URLStreamHandler

Alternative implementation of URLStreamHandler for JAR files that supports customizable JAR caching policies. It addresses bugs 4405789, 4388666, 4639900 in Java Bug Parade. SUN recommends to disable caches completely as a workaround for those bugs; however, this may significantly affect performance in case of resources downloaded from the network. This class is a part of the solution that allows to tailor the caching policy according to the program needs, with cache-per-classloader default policy.

Version:
1.0
Author:
Dawid Kurzyniec
See Also:
JarURLConnection

Constructor Summary
JarURLStreamHandler()
          Create new JarURLStreamHandler that will use its separate URL cache managed by a newly created JarProxy instance.
JarURLStreamHandler(JarURLConnection.JarOpener opener)
          Create new JarURLStreamHandler that will use specified JAR opener.
 
Method Summary
 java.net.URLConnection openConnection(java.net.URL url)
           
protected  void parseURL(java.net.URL u, java.lang.String spec, int start, int limit)
           
 
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarURLStreamHandler

public JarURLStreamHandler()
Create new JarURLStreamHandler that will use its separate URL cache managed by a newly created JarProxy instance.


JarURLStreamHandler

public JarURLStreamHandler(JarURLConnection.JarOpener opener)
Create new JarURLStreamHandler that will use specified JAR opener.

Parameters:
opener - JAR opener that handles file download and caching
Method Detail

openConnection

public java.net.URLConnection openConnection(java.net.URL url)
                                      throws java.io.IOException
Throws:
java.io.IOException

parseURL

protected void parseURL(java.net.URL u,
                        java.lang.String spec,
                        int start,
                        int limit)