Class XJarURLConnection


  • public class XJarURLConnection
    extends AbstractJarURLConnection
    Extends the JarURLConnection to handle XJarFile instead of JarFile's.
    Author:
    Christopher Mindus
    • Field Summary

      • Fields inherited from class java.net.URLConnection

        allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
    • Constructor Summary

      Constructors 
      ModifierConstructorDescription
      protectedXJarURLConnection​(java.net.URL url)
      Creates an XJar URL connection.
      protectedXJarURLConnection​(java.net.URL url, XJarFile jarFile)
      Creates an XJar URL connection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      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 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XJarURLConnection

        protected XJarURLConnection​(java.net.URL url)
                             throws java.net.MalformedURLException
        Creates an XJar URL connection.
        Parameters:
        url - The requested URL.
        Throws:
        java.net.MalformedURLException
      • XJarURLConnection

        protected XJarURLConnection​(java.net.URL url,
                                    XJarFile jarFile)
                             throws java.net.MalformedURLException
        Creates an XJar URL connection.
        Parameters:
        url - The requested URL.
        jarFile - The open Jar file.
        Throws:
        java.net.MalformedURLException
    • Method Detail

      • getJarFile

        public IJarFile getJarFile()
                            throws java.io.IOException
        Gets the IJarFile.
        Specified by:
        getJarFile in class AbstractJarURLConnection
        Returns:
        The IJarFile instance.
        Throws:
        java.io.IOException - if an IOException occurs while trying to connect to the JAR file for this connection.
        See Also:
        URLConnection.connect()
      • connect

        public void connect()
                     throws java.io.IOException
        Opens a communications link to the resource referenced by this URL, if such a connection has not already been established.

        If the connect method is called when the connection has already been opened (indicated by the connected field having the value true), the call is ignored.

        Specified by:
        connect in class java.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.IOException
        Returns an input stream that reads from this open connection.
        Overrides:
        getInputStream in class java.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.