Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.net

Class JarURLConnection

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


public abstract class JarURLConnection

extends URLConnection

This abstract class represents a common superclass for implementations of jar URL's. A jar URL is a special type of URL that allows JAR files on remote systems to be accessed. It has the form:

jar:!/file/within/jarfile

for example:

jar:http://www.urbanophile.com/java/foo.jar!/com/urbanophile/bar.class

That example URL points to the file /com/urbanophile/bar.class in the remote JAR file http://www.urbanophile.com/java/foo.jar. The HTTP protocol is used only as an example. Any supported remote protocol can be used.

This class currently works by retrieving the entire jar file into a local cache file, then performing standard jar operations on it. (At least this is true for the default protocol implementation).

Author:

Constructor Summary

JarURLConnection(java.net.URL url)

Creates a JarURLConnection from a URL objects

Method Summary

java.util.jar.AttributesgetAttributes()

Returns the Attributes for the Jar entry specified by the URL or null if none
java.security.cert.Certificate[]getCertificates()

Returns an array of Certificate objects for the jar file entry specified by this URL or null if there are none
java.lang.StringgetEntryName()

Returns the "entry name" portion of the jar URL.
java.util.jar.JarEntrygetJarEntry()

Returns the entry in this jar file specified by the URL.
java.util.jar.JarFilegetJarFile()

Returns a read-only JarFile object for the remote jar file
java.net.URLgetJarFileURL()

This method returns the "real" URL where the JarFile is located.
java.util.jar.AttributesgetMainAttributes()

Returns the main Attributes for the jar file specified in the URL or null if there are none
java.util.jar.ManifestgetManifest()

Returns a Manifest object for this jar file, or null if there is no manifest.

Constructor Details

JarURLConnection

protected JarURLConnection(java.net.URL url)

Creates a JarURLConnection from a URL objects

Parameters:


Method Details

getAttributes

public Attributes getAttributes()

Returns the Attributes for the Jar entry specified by the URL or null if none

Returns:

Throws:


getCertificates

public Certificate[] getCertificates()

Returns an array of Certificate objects for the jar file entry specified by this URL or null if there are none

Returns:

Throws:


getEntryName

public String getEntryName()

Returns the "entry name" portion of the jar URL. This is the portion after the "!/" in the jar URL that represents the pathname inside the actual jar file.

Returns:


getJarEntry

public JarEntry getJarEntry()

Returns the entry in this jar file specified by the URL.

Returns:

Throws:


getJarFile

public JarFile getJarFile()

Returns a read-only JarFile object for the remote jar file

Returns:

Throws:


getJarFileURL

public URL getJarFileURL()

This method returns the "real" URL where the JarFile is located. //****Is this right?*****

Returns:


getMainAttributes

public Attributes getMainAttributes()

Returns the main Attributes for the jar file specified in the URL or null if there are none

Returns:

Throws:


getManifest

public Manifest getManifest()

Returns a Manifest object for this jar file, or null if there is no manifest.

Returns:

Throws: