public class JarUrlConnection
extends java.net.JarURLConnection
URLConnection capable of handling multiply-nested jars.| Modifier and Type | Field | Description |
|---|---|---|
private java.net.URL |
baseResource |
Base resource.
|
private java.io.InputStream |
in |
Terminal input-stream.
|
private java.lang.String[] |
segments |
Additional nested segments.
|
| Constructor | Description |
|---|---|
JarUrlConnection(java.net.URL url) |
Construct.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
connect() |
|
protected java.net.URL |
getBaseResource() |
Retrieve the base resource
URL. |
java.io.InputStream |
getInputStream() |
|
java.util.jar.JarFile |
getJarFile() |
|
protected java.io.InputStream |
getSegmentInputStream(java.io.InputStream baseIn,
java.lang.String segment) |
Retrieve the
InputStream for the nesting
segment relative to a base InputStream. |
protected java.lang.String[] |
getSegments() |
Retrieve the nesting path segments.
|
protected static java.net.URL |
normaliseURL(java.net.URL url) |
|
protected void |
setupBaseResourceInputStream() |
Setup the
InputStream purely from the base resource. |
protected void |
setupPathedInputStream() |
Setup the
InputStream for URL with nested segments. |
getAttributes, getCertificates, getEntryName, getJarEntry, getJarFileURL, getMainAttributes, getManifestclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toStringprivate java.net.URL baseResource
private java.lang.String[] segments
private java.io.InputStream in
JarUrlConnection(java.net.URL url)
throws java.io.IOException
url - Target URL of the connections.java.io.IOException - If an error occurs while attempting to initialize
the connection.protected static java.net.URL normaliseURL(java.net.URL url)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionprotected java.lang.String[] getSegments()
protected java.net.URL getBaseResource()
URL.public void connect()
throws java.io.IOException
connect in class java.net.URLConnectionjava.io.IOExceptionURLConnectionprotected void setupBaseResourceInputStream()
throws java.io.IOException
InputStream purely from the base resource.java.io.IOException - If an I/O error occurs.protected void setupPathedInputStream()
throws java.io.IOException
InputStream for URL with nested segments.java.io.IOException - If an I/O error occurs.protected java.io.InputStream getSegmentInputStream(java.io.InputStream baseIn,
java.lang.String segment)
throws java.io.IOException
InputStream for the nesting
segment relative to a base InputStream.baseIn - The base input-stream.segment - The nesting segment path.java.io.IOException - If an I/O error occurs.public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class java.net.URLConnectionjava.io.IOExceptionURLConnectionpublic java.util.jar.JarFile getJarFile()
throws java.io.IOException
getJarFile in class java.net.JarURLConnectionjava.io.IOExceptionJarURLConnection.getJarFile()