public abstract class JarURLConnection extends URLConnection
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).
| Modifier and Type | Field and Description |
|---|---|
protected URLConnection |
jarFileURLConnection
The connection to the jar file itself.
|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches| Modifier | Constructor and Description |
|---|---|
protected |
JarURLConnection(URL url)
Creates a JarURLConnection from an URL object
|
| Modifier and Type | Method and Description |
|---|---|
java.util.jar.Attributes |
getAttributes()
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.String |
getEntryName()
Returns the "entry name" portion of the jar URL.
|
java.util.jar.JarEntry |
getJarEntry()
Returns the entry in this jar file specified by the URL.
|
abstract java.util.jar.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.
|
java.util.jar.Attributes |
getMainAttributes()
Returns the main Attributes for the jar file specified in the URL or
null if there are none
|
java.util.jar.Manifest |
getManifest()
Returns a Manifest object for this jar file, or null if there is no
manifest.
|
addRequestProperty, connect, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getInputStream, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toStringprotected URLConnection jarFileURLConnection
protected JarURLConnection(URL url) throws MalformedURLException
url - The URL object for this connection.MalformedURLException - If url is invalidpublic URL getJarFileURL()
public java.lang.String getEntryName()
public java.util.jar.JarEntry getJarEntry() throws java.io.IOException
java.io.IOException - If an error occurspublic abstract java.util.jar.JarFile getJarFile() throws java.io.IOException
java.io.IOException - If an error occurspublic java.security.cert.Certificate[] getCertificates() throws java.io.IOException
java.io.IOException - If an error occurspublic java.util.jar.Attributes getMainAttributes() throws java.io.IOException
java.io.IOException - If an error occurspublic java.util.jar.Attributes getAttributes() throws java.io.IOException
java.io.IOException - If an error occurspublic java.util.jar.Manifest getManifest() throws java.io.IOException
java.io.IOException - If an error occurs