java.lang.Object
java.net.URLConnection
java.net.JarURLConnection
edu.emory.mathcs.util.classloader.jar.JarURLConnection
- public class JarURLConnection
- extends java.net.JarURLConnection
Alternative implementation of java.net.JarURLConnection which
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
Nested Class Summary |
static interface |
JarURLConnection.JarOpener
Abstraction of JAR opener which allows to implement various caching
policies. |
Methods inherited from class java.net.URLConnection |
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString |
opener
final JarURLConnection.JarOpener opener
connected
boolean connected
jfile
java.util.jar.JarFile jfile
jentry
java.util.jar.JarEntry jentry
JarURLConnection
public JarURLConnection(java.net.URL url,
JarURLConnection.JarOpener opener)
throws java.io.IOException
- Creates JarURLConnection for a given URL, using specified JAR opener.
connect
public void connect()
throws java.io.IOException
- Description copied from class:
java.net.URLConnection
- Establishes the actual connection to the URL associated with this
connection object
getJarFile
public java.util.jar.JarFile getJarFile()
throws java.io.IOException
- Description copied from class:
java.net.JarURLConnection
- Returns a read-only JarFile object for the remote jar file
getJarEntry
public java.util.jar.JarEntry getJarEntry()
throws java.io.IOException
- Description copied from class:
java.net.JarURLConnection
- Returns the entry in this jar file specified by the URL.
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException
- Description copied from class:
java.net.URLConnection
- Returns an InputStream for this connection. As this default
implementation returns null, subclasses should override this method