Final

java.net
Class JarURLConnection

java.lang.Object
  |
  +--java.net.URLConnection
        |
        +--java.net.JarURLConnection

public abstract class JarURLConnection
extends URLConnection

This class establishes a connection to a URL using the jar protocol. Jar URLs are specified as follows:

jar:!/{entry}
where "!/" is called a seperator.


Field Summary
protected  URLConnection jarFileURLConnection
           
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
protected JarURLConnection(URL url)
          Contructs an instance of JarURLConnection.
 
Method Summary
 Attributes getAttributes()
          Answers the attributes of the JarEntry referenced by this JarURLConnection.
 Certificate[] getCertificates()
          Answers the Certificates of the JarEntry referenced by this URLConnection.
 String getEntryName()
          Answers the JarEntry name of the entry referenced by this URLConnection.
 JarEntry getJarEntry()
          Answers the JarEntry of the entry referenced by this URLConnection.
abstract  JarFile getJarFile()
          Answers the the JarFile referenced by this URLConnection.
 URL getJarFileURL()
          Answers the URL of the JarFile referenced by this URLConnection.
 Attributes getMainAttributes()
          Answers the main Attributes of the JarFile referenced by this URLConnection.
 Manifest getManifest()
          Answers the Manifest associated with the Jar URL
 
Methods inherited from class java.net.URLConnection
addRequestProperty, connect, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getInputStream, 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

jarFileURLConnection

protected URLConnection jarFileURLConnection
Constructor Detail

JarURLConnection

protected JarURLConnection(URL url)
                    throws MalformedURLException
Contructs an instance of JarURLConnection.

Parameters:
url - java.net.URL the URL that contains the location to connect to
Method Detail

getAttributes

public Attributes getAttributes()
                         throws IOException
Answers the attributes of the JarEntry referenced by this JarURLConnection.

Returns:
java.util.jar.Attributes the attributes of the the JarEntry
Throws:
IOException - thrown if an IO exception occurs while retrieving the JarEntry

getCertificates

public Certificate[] getCertificates()
                              throws IOException
Answers the Certificates of the JarEntry referenced by this URLConnection. This method will return null until the InputStream has been completely verified

Returns:
Certificate[] the Certificates of the JarEntry.
Throws:
IOException - thrown if there is an IO exception occurs while getting the JarEntry.

getEntryName

public String getEntryName()
Answers the JarEntry name of the entry referenced by this URLConnection.

Returns:
java.lang.String the JarEntry name

getJarEntry

public JarEntry getJarEntry()
                     throws IOException
Answers the JarEntry of the entry referenced by this URLConnection.

Returns:
java.util.jar.JarEntry the JarEntry referenced
IOException

getManifest

public Manifest getManifest()
                     throws IOException
Answers the Manifest associated with the Jar URL

Returns:
java.util.jar.Manifest The JarFile's Manifest
IOException

getJarFile

public abstract JarFile getJarFile()
                            throws IOException
Answers the the JarFile referenced by this URLConnection.

Returns:
java.util.jar.JarFile the JarFile
Throws:
IOException - thrown if an IO exception occurs while retrieving the Jar file

getJarFileURL

public URL getJarFileURL()
Answers the URL of the JarFile referenced by this URLConnection.

Returns:
java.net.URL the URL of the JarFile.

getMainAttributes

public Attributes getMainAttributes()
                             throws IOException
Answers the main Attributes of the JarFile referenced by this URLConnection.

Returns:
java.util.jar.Attributes the Attributes of the the JarFile
Throws:
IOException - thrown if an IO exception occurs while retrieving the JarFile

Final

Licensed Materials - Property of IBM
(C) Copyright IBM Corp. 2006 All Rights Reserved.