Class JarUrlConnection
- java.lang.Object
-
- java.net.URLConnection
-
- java.net.JarURLConnection
-
- org.codehaus.classworlds.uberjar.protocol.jar.JarUrlConnection
-
public class JarUrlConnection extends java.net.JarURLConnectionURLConnectioncapable of handling multiply-nested jars.- Version:
- $Id: JarUrlConnection.java 78 2004-07-01 13:59:13Z jvanzyl $
- Author:
- bob mcwhirter
-
-
Field Summary
Fields Modifier and Type Field Description private java.net.URLbaseResourceBase resource.private java.io.InputStreaminTerminal input-stream.private java.lang.String[]segmentsAdditional nested segments.
-
Constructor Summary
Constructors Constructor Description JarUrlConnection(java.net.URL url)Construct.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()protected java.net.URLgetBaseResource()Retrieve the base resourceURL.java.io.InputStreamgetInputStream()java.util.jar.JarFilegetJarFile()protected java.io.InputStreamgetSegmentInputStream(java.io.InputStream baseIn, java.lang.String segment)Retrieve theInputStreamfor the nesting segment relative to a baseInputStream.protected java.lang.String[]getSegments()Retrieve the nesting path segments.protected static java.net.URLnormaliseURL(java.net.URL url)protected voidsetupBaseResourceInputStream()Setup theInputStreampurely from the base resource.protected voidsetupPathedInputStream()Setup theInputStreamfor URL with nested segments.-
Methods inherited from class java.net.JarURLConnection
getAttributes, getCertificates, getEntryName, getJarEntry, getJarFileURL, getMainAttributes, getManifest
-
Methods inherited from class java.net.URLConnection
addRequestProperty, 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, toString
-
-
-
-
Method Detail
-
normaliseURL
protected static java.net.URL normaliseURL(java.net.URL url) throws java.net.MalformedURLException- Throws:
java.net.MalformedURLException
-
getSegments
protected java.lang.String[] getSegments()
Retrieve the nesting path segments.- Returns:
- The segments.
-
getBaseResource
protected java.net.URL getBaseResource()
Retrieve the base resourceURL.- Returns:
- The base resource url.
-
connect
public void connect() throws java.io.IOException- Specified by:
connectin classjava.net.URLConnection- Throws:
java.io.IOException- See Also:
URLConnection
-
setupBaseResourceInputStream
protected void setupBaseResourceInputStream() throws java.io.IOExceptionSetup theInputStreampurely from the base resource.- Throws:
java.io.IOException- If an I/O error occurs.
-
setupPathedInputStream
protected void setupPathedInputStream() throws java.io.IOExceptionSetup theInputStreamfor URL with nested segments.- Throws:
java.io.IOException- If an I/O error occurs.
-
getSegmentInputStream
protected java.io.InputStream getSegmentInputStream(java.io.InputStream baseIn, java.lang.String segment) throws java.io.IOExceptionRetrieve theInputStreamfor the nesting segment relative to a baseInputStream.- Parameters:
baseIn- The base input-stream.segment- The nesting segment path.- Returns:
- The input-stream to the segment.
- Throws:
java.io.IOException- If an I/O error occurs.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException- Overrides:
getInputStreamin classjava.net.URLConnection- Throws:
java.io.IOException- See Also:
URLConnection
-
getJarFile
public java.util.jar.JarFile getJarFile() throws java.io.IOException- Specified by:
getJarFilein classjava.net.JarURLConnection- Returns:
- JarFile
- Throws:
java.io.IOException- See Also:
JarURLConnection.getJarFile()
-
-