Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.java.net.protocol.jar
Class Connection  view Connection download Connection.java

java.lang.Object
  extended byjava.net.URLConnection
      extended byjava.net.JarURLConnection
          extended bygnu.java.net.protocol.jar.Connection

public final class Connection
extends java.net.JarURLConnection

This subclass of java.net.JarURLConnection models a URLConnection via the "jar" protocol.


Nested Class Summary
static class Connection.JarFileCache
           
 
Field Summary
private static java.text.SimpleDateFormat dateFormat
          HTTP-style DateFormat, used to format the last-modified header.
private  java.util.jar.JarEntry jar_entry
           
private  java.util.jar.JarFile jar_file
           
private  java.net.URL jar_url
           
 
Fields inherited from class java.net.JarURLConnection
jarFileURLConnection
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
protected Connection(java.net.URL url)
           
 
Method Summary
 void connect()
          Establishes the actual connection to the URL associated with this connection object
 int getContentLength()
          Returns the value of the content-length header field or -1 if the value is not known or not present.
 java.lang.String getHeaderField(java.lang.String field)
          Returns a String representing the value of the header field having the named key.
 java.io.InputStream getInputStream()
          Returns an InputStream for this connection.
 java.util.jar.JarFile getJarFile()
          Returns a read-only JarFile object for the remote jar file
 long getLastModified()
          Returns the value of the last-modified header field or 0 if not known known or not present.
 
Methods inherited from class java.net.JarURLConnection
getAttributes, getCertificates, getEntryName, getJarEntry, getJarFileURL, getMainAttributes, getManifest
 
Methods inherited from class java.net.URLConnection
addRequestProperty, getAllowUserInteraction, getContent, getContent, getContentEncoding, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getOutputStream, getPermission, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dateFormat

private static java.text.SimpleDateFormat dateFormat
HTTP-style DateFormat, used to format the last-modified header. Lazy initialized since jar files are used during bootstrapping.


jar_file

private java.util.jar.JarFile jar_file

jar_entry

private java.util.jar.JarEntry jar_entry

jar_url

private java.net.URL jar_url
Constructor Detail

Connection

protected Connection(java.net.URL url)
              throws java.net.MalformedURLException
Method Detail

connect

public void connect()
             throws java.io.IOException
Description copied from class: java.net.URLConnection
Establishes the actual connection to the URL associated with this connection object


getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Description copied from class: java.net.URLConnection
Returns an InputStream for this connection. As this default implementation returns null, subclasses should override this method


getJarFile

public java.util.jar.JarFile getJarFile()
                                 throws java.io.IOException
Description copied from class: java.net.JarURLConnection
Returns a read-only JarFile object for the remote jar file


getHeaderField

public java.lang.String getHeaderField(java.lang.String field)
Description copied from class: java.net.URLConnection
Returns a String representing the value of the header field having the named key. Returns null if the header field does not exist.


getContentLength

public int getContentLength()
Description copied from class: java.net.URLConnection
Returns the value of the content-length header field or -1 if the value is not known or not present.


getLastModified

public long getLastModified()
Description copied from class: java.net.URLConnection
Returns the value of the last-modified header field or 0 if not known known or not present. If populated, the return value is the number of seconds since midnight on 1/1/1970.