org.codehaus.classworlds.uberjar.protocol.jar

Class JarUrlConnection


public class JarUrlConnection
extends JarURLConnection

URLConnection capable of handling multiply-nested jars.
Version:
$Id: JarUrlConnection.java 78 2004-07-01 13:59:13Z jvanzyl $
Author:
bob mcwhirter

Method Summary

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.

Method Details

connect

public void connect()
            throws IOException
See Also:
java.net.URLConnection

getBaseResource

protected URL getBaseResource()
Retrieve the base resource URL.
Returns:
The base resource url.

getInputStream

public InputStream getInputStream()
            throws IOException
See Also:
java.net.URLConnection

getJarFile

public JarFile getJarFile()
            throws IOException
Returns:
JarFile
See Also:
java.net.JarURLConnection.getJarFile()

getSegmentInputStream

protected InputStream getSegmentInputStream(InputStream baseIn,
                                            String segment)
            throws IOException
Retrieve the InputStream for the nesting segment relative to a base InputStream.
Parameters:
baseIn - The base input-stream.
segment - The nesting segment path.
Returns:
The input-stream to the segment.

getSegments

protected String[] getSegments()
Retrieve the nesting path segments.
Returns:
The segments.

normaliseURL

protected static URL normaliseURL(URL url)
            throws MalformedURLException

setupBaseResourceInputStream

protected void setupBaseResourceInputStream()
            throws IOException
Setup the InputStream purely from the base resource.

setupPathedInputStream

protected void setupPathedInputStream()
            throws IOException
Setup the InputStream for URL with nested segments.