no.sesat.search.http.protocol.jar
Class JarURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.JarURLConnection
          extended by no.sesat.search.http.protocol.jar.JarURLConnection

public class JarURLConnection
extends JarURLConnection

Since:
1.2
Author:
Benjamin Renaud

Field Summary
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
JarURLConnection(URL url, sun.net.www.protocol.jar.Handler handler)
           
 
Method Summary
 void addRequestProperty(String key, String value)
          Adds a general request property specified by a key-value pair.
 void connect()
           
 boolean getAllowUserInteraction()
          Returns the value of the allowUserInteraction field for this object.
 Object getContent()
           
 int getContentLength()
           
 String getContentType()
           
 boolean getDefaultUseCaches()
          Returns the default value of a URLConnection's useCaches flag.
 String getHeaderField(String name)
           
 InputStream getInputStream()
           
 JarEntry getJarEntry()
           
 JarFile getJarFile()
           
 Permission getPermission()
           
 Map<String,List<String>> getRequestProperties()
          Returns an unmodifiable Map of general request properties for this connection.
 String getRequestProperty(String key)
          Returns the value of the named general request property for this connection.
 boolean getUseCaches()
          Returns the value of this URLConnection's useCaches field.
 void setAllowUserInteraction(boolean allowuserinteraction)
          Set the value of the allowUserInteraction field of this URLConnection.
 void setDefaultUseCaches(boolean defaultusecaches)
          Sets the default value of the useCaches field to the specified value.
 void setIfModifiedSince(long ifmodifiedsince)
          Sets the value of the ifModifiedSince field of this URLConnection to the specified value.
 void setRequestProperty(String key, String value)
          Sets the general request property.
 void setUseCaches(boolean usecaches)
          Sets the value of the useCaches field of this URLConnection to the specified value.
 
Methods inherited from class java.net.JarURLConnection
getAttributes, getCertificates, getEntryName, getJarFileURL, getMainAttributes, getManifest
 
Methods inherited from class java.net.URLConnection
getConnectTimeout, getContent, getContentEncoding, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getReadTimeout, getURL, guessContentTypeFromName, guessContentTypeFromStream, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDoInput, setDoOutput, setFileNameMap, setReadTimeout, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JarURLConnection

public JarURLConnection(URL url,
                        sun.net.www.protocol.jar.Handler handler)
                 throws MalformedURLException,
                        IOException
Throws:
MalformedURLException
IOException
Method Detail

getJarFile

public JarFile getJarFile()
                   throws IOException
Specified by:
getJarFile in class JarURLConnection
Throws:
IOException

getJarEntry

public JarEntry getJarEntry()
                     throws IOException
Overrides:
getJarEntry in class JarURLConnection
Throws:
IOException

getPermission

public Permission getPermission()
                         throws IOException
Overrides:
getPermission in class URLConnection
Throws:
IOException

connect

public void connect()
             throws IOException
Specified by:
connect in class URLConnection
Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Overrides:
getInputStream in class URLConnection
Throws:
IOException

getContentLength

public int getContentLength()
Overrides:
getContentLength in class URLConnection

getContent

public Object getContent()
                  throws IOException
Overrides:
getContent in class URLConnection
Throws:
IOException

getContentType

public String getContentType()
Overrides:
getContentType in class URLConnection

getHeaderField

public String getHeaderField(String name)
Overrides:
getHeaderField in class URLConnection

setRequestProperty

public void setRequestProperty(String key,
                               String value)
Sets the general request property.

Overrides:
setRequestProperty in class URLConnection
Parameters:
key - the keyword by which the request is known (e.g., "accept").
value - the value associated with it.

getRequestProperty

public String getRequestProperty(String key)
Returns the value of the named general request property for this connection.

Overrides:
getRequestProperty in class URLConnection
Returns:
the value of the named general request property for this connection.

addRequestProperty

public void addRequestProperty(String key,
                               String value)
Adds a general request property specified by a key-value pair. This method will not overwrite existing values associated with the same key.

Overrides:
addRequestProperty in class URLConnection
Parameters:
key - the keyword by which the request is known (e.g., "accept").
value - the value associated with it.

getRequestProperties

public Map<String,List<String>> getRequestProperties()
Returns an unmodifiable Map of general request properties for this connection. The Map keys are Strings that represent the request-header field names. Each Map value is a unmodifiable List of Strings that represents the corresponding field values.

Overrides:
getRequestProperties in class URLConnection
Returns:
a Map of the general request properties for this connection.

setAllowUserInteraction

public void setAllowUserInteraction(boolean allowuserinteraction)
Set the value of the allowUserInteraction field of this URLConnection.

Overrides:
setAllowUserInteraction in class URLConnection
Parameters:
allowuserinteraction - the new value.
See Also:
URLConnection.allowUserInteraction

getAllowUserInteraction

public boolean getAllowUserInteraction()
Returns the value of the allowUserInteraction field for this object.

Overrides:
getAllowUserInteraction in class URLConnection
Returns:
the value of the allowUserInteraction field for this object.
See Also:
URLConnection.allowUserInteraction

setUseCaches

public void setUseCaches(boolean usecaches)
Sets the value of the useCaches field of this URLConnection to the specified value.

Some protocols do caching of documents. Occasionally, it is important to be able to "tunnel through" and ignore the caches (e.g., the "reload" button in a browser). If the UseCaches flag on a connection is true, the connection is allowed to use whatever caches it can. If false, caches are to be ignored. The default value comes from DefaultUseCaches, which defaults to true.

Overrides:
setUseCaches in class URLConnection
See Also:
URLConnection.useCaches

getUseCaches

public boolean getUseCaches()
Returns the value of this URLConnection's useCaches field.

Overrides:
getUseCaches in class URLConnection
Returns:
the value of this URLConnection's useCaches field.
See Also:
URLConnection.useCaches

setIfModifiedSince

public void setIfModifiedSince(long ifmodifiedsince)
Sets the value of the ifModifiedSince field of this URLConnection to the specified value.

Overrides:
setIfModifiedSince in class URLConnection
Parameters:
value - the new value.
See Also:
URLConnection.ifModifiedSince

setDefaultUseCaches

public void setDefaultUseCaches(boolean defaultusecaches)
Sets the default value of the useCaches field to the specified value.

Overrides:
setDefaultUseCaches in class URLConnection
Parameters:
defaultusecaches - the new value.
See Also:
URLConnection.useCaches

getDefaultUseCaches

public boolean getDefaultUseCaches()
Returns the default value of a URLConnection's useCaches flag.

Ths default is "sticky", being a part of the static state of all URLConnections. This flag applies to the next, and all following URLConnections that are created.

Overrides:
getDefaultUseCaches in class URLConnection
Returns:
the default value of a URLConnection's useCaches flag.
See Also:
URLConnection.useCaches


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.