Package com.iizix.util.memjar
Class MemoryJarURLConnection
- java.lang.Object
- java.net.URLConnection
- com.iizix.util.AbstractJarURLConnection
- com.iizix.util.memjar.MemoryJarURLConnection
public class MemoryJarURLConnection extends AbstractJarURLConnection
Extends the JarURLConnection to handle in-memory loaded MemoryJarFile instead of JarFile.- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.util.AbstractJarURLConnection
jarFileURLConnection
Constructor Summary
Constructors Modifier Constructor Description protectedMemoryJarURLConnection(java.net.URL url)Creates an MemoryJar URL connection.protectedMemoryJarURLConnection(java.net.URL url, MemoryJarFile jarFile)Creates an MemoryJar URL connection.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.java.io.InputStreamgetInputStream()Returns an input stream that reads from this open connection.IJarFilegetJarFile()Gets the IJarFile.Methods inherited from class com.iizix.util.AbstractJarURLConnection
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
Constructor Detail
MemoryJarURLConnection
protected MemoryJarURLConnection(java.net.URL url) throws java.net.MalformedURLExceptionCreates an MemoryJar URL connection.- Parameters:
url- The requested URL.- Throws:
java.net.MalformedURLException
MemoryJarURLConnection
protected MemoryJarURLConnection(java.net.URL url, MemoryJarFile jarFile) throws java.net.MalformedURLExceptionCreates an MemoryJar URL connection.- Parameters:
jarFile- The Jar file.- Throws:
java.net.MalformedURLException
Method Detail
getJarFile
public IJarFile getJarFile()
Gets the IJarFile.- Specified by:
getJarFilein classAbstractJarURLConnection- Returns:
- The IJarFile instance.
- See Also:
URLConnection.connect()
connect
public void connect() throws java.io.IOExceptionOpens a communications link to the resource referenced by this URL, if such a connection has not already been established.If the
connectmethod is called when the connection has already been opened (indicated by theconnectedfield having the valuetrue), the call is ignored.- Specified by:
connectin classjava.net.URLConnection- Throws:
java.io.IOException- if an I/O error occurs while opening the connection.
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionReturns an input stream that reads from this open connection.- Overrides:
getInputStreamin classjava.net.URLConnection- Returns:
- an input stream that reads from this open connection.
- Throws:
java.io.IOException- if an I/O error occurs while creating the input stream.