Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.emory.mathcs.util.classloader.jar
Class JarURLConnection  view JarURLConnection download JarURLConnection.java

java.lang.Object
  extended byjava.net.URLConnection
      extended byjava.net.JarURLConnection
          extended byedu.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.
 
Field Summary
(package private)  boolean connected
           
(package private)  java.util.jar.JarEntry jentry
           
(package private)  java.util.jar.JarFile jfile
           
(package private)  JarURLConnection.JarOpener opener
           
 
Fields inherited from class java.net.JarURLConnection
jarFileURLConnection
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
JarURLConnection(java.net.URL url, JarURLConnection.JarOpener opener)
          Creates JarURLConnection for a given URL, using specified JAR opener.
 
Method Summary
 void connect()
          Establishes the actual connection to the URL associated with this connection object
 java.io.InputStream getInputStream()
          Returns an InputStream for this connection.
 java.util.jar.JarEntry getJarEntry()
          Returns the entry in this jar file specified by the URL.
 java.util.jar.JarFile getJarFile()
          Returns a read-only JarFile object for the remote jar file
 
Methods inherited from class java.net.JarURLConnection
getAttributes, getCertificates, getEntryName, getJarFileURL, getMainAttributes, getManifest
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

opener

final JarURLConnection.JarOpener opener

connected

boolean connected

jfile

java.util.jar.JarFile jfile

jentry

java.util.jar.JarEntry jentry
Constructor Detail

JarURLConnection

public JarURLConnection(java.net.URL url,
                        JarURLConnection.JarOpener opener)
                 throws java.io.IOException
Creates JarURLConnection for a given URL, using specified JAR opener.

Method Detail

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