|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.net.URLConnection
java.net.JarURLConnection
org.codehaus.classworlds.uberjar.protocol.jar.NonLockingJarUrlConnection
public class NonLockingJarUrlConnection
This is copied from Classwords 1.1 org.codehaus.classworlds.uberjar.protocol.jar.JarURLConnection so that an additional dependency does not need to be added to plugins. The formatting is left as is to reduce the diff.
The setupPathedInputStream() method has been modified to improve the speed of resource lookups. It now uses a ZipEntry to get random access to entries in the JAR. This change removes the ability for this connection class to load resources from JARs nested inside the outer JAR. This is not used in atlassian-plugin because the inner JAR loading is handled byPluginClassLoader.
| Field Summary |
|---|
| Fields inherited from class java.net.JarURLConnection |
|---|
jarFileURLConnection |
| Fields inherited from class java.net.URLConnection |
|---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches |
| 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. |
| Methods inherited from class java.net.JarURLConnection |
|---|
getAttributes, getCertificates, getEntryName, getJarEntry, getJarFileURL, getMainAttributes, getManifest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
protected static URL normaliseURL(URL url)
throws MalformedURLException
MalformedURLExceptionprotected String[] getSegments()
protected URL getBaseResource()
URL.
public void connect()
throws IOException
connect in class URLConnectionIOExceptionURLConnection
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 URLConnectionIOExceptionURLConnection
public JarFile getJarFile()
throws IOException
getJarFile in class JarURLConnectionIOExceptionJarURLConnection.getJarFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||