|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.net.URLConnection
java.net.JarURLConnection
public abstract class JarURLConnection
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:<standard URL pointing to jar filei>!/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).
| Field Summary | |
|---|---|
protected URLConnection |
jarFileURLConnection
The connection to the jar file itself. |
| Fields inherited from class java.net.URLConnection |
|---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
| Constructor Summary | |
|---|---|
protected |
JarURLConnection(URL url)
Creates a JarURLConnection from an URL object |
| Method Summary | |
|---|---|
Attributes |
getAttributes()
Returns the Attributes for the Jar entry specified by the URL or null if none |
Certificate[] |
getCertificates()
Returns an array of Certificate objects for the jar file entry specified by this URL or null if there are none |
String |
getEntryName()
Returns the "entry name" portion of the jar URL. |
JarEntry |
getJarEntry()
Returns the entry in this jar file specified by the URL. |
abstract JarFile |
getJarFile()
Returns a read-only JarFile object for the remote jar file |
URL |
getJarFileURL()
This method returns the "real" URL where the JarFile is located. |
Attributes |
getMainAttributes()
Returns the main Attributes for the jar file specified in the URL or null if there are none |
Manifest |
getManifest()
Returns a Manifest object for this jar file, or null if there is no manifest. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected URLConnection jarFileURLConnection
| Constructor Detail |
|---|
protected JarURLConnection(URL url)
throws MalformedURLException
url - The URL object for this connection.
MalformedURLException - If url is invalid| Method Detail |
|---|
public URL getJarFileURL()
public String getEntryName()
public JarEntry getJarEntry()
throws IOException
IOException - If an error occurs
public abstract JarFile getJarFile()
throws IOException
IOException - If an error occurs
public Certificate[] getCertificates()
throws IOException
IOException - If an error occurs
public Attributes getMainAttributes()
throws IOException
IOException - If an error occurs
public Attributes getAttributes()
throws IOException
IOException - If an error occurs
public Manifest getManifest()
throws IOException
IOException - If an error occurs
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||