public class JarUrlConnection extends JarURLConnection
URLConnection
capable of handling multiply-nested jars.jarFileURLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
Constructor and Description |
---|
JarUrlConnection(URL url)
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
connect() |
protected URL |
getBaseResource()
Retrieve the base resource
URL . |
InputStream |
getInputStream() |
JarFile |
getJarFile() |
protected InputStream |
getSegmentInputStream(InputStream baseIn,
String segment)
Retrieve the
InputStream for the nesting
segment relative to a base InputStream . |
protected String[] |
getSegments()
Retrieve the nesting path segments.
|
protected static URL |
normaliseURL(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, getManifest
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, 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, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
public JarUrlConnection(URL url) throws IOException
url
- Target URL of the connections.IOException
- If an error occurs while attempting to initialize
the connection.protected static URL normaliseURL(URL url) throws MalformedURLException
MalformedURLException
protected String[] getSegments()
protected URL getBaseResource()
URL
.public void connect() throws IOException
connect
in class URLConnection
IOException
URLConnection
protected void setupBaseResourceInputStream() throws IOException
InputStream
purely from the base resource.IOException
- If an I/O error occurs.protected void setupPathedInputStream() throws IOException
InputStream
for URL with nested segments.IOException
- If an I/O error occurs.protected InputStream getSegmentInputStream(InputStream baseIn, String segment) throws IOException
InputStream
for the nesting
segment relative to a base InputStream
.baseIn
- The base input-stream.segment
- The nesting segment path.IOException
- If an I/O error occurs.public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
IOException
URLConnection
public JarFile getJarFile() throws IOException
getJarFile
in class JarURLConnection
IOException
JarURLConnection.getJarFile()
Copyright © 2012. All Rights Reserved.