<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.net.URLConnection
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.URL.html#_top_">Previous</a>  <a href="java.net.URLEncoder.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.net.URLConnection
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----java.net.URLConnection
</pre>
<hr>
<dl>
  <dt> public abstract class <b>URLConnection</b>
  <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
</dl>
The abstract class <code>URLConnection</code> is the superclass
 of all classes that represent a communications link between the
 application and a URL. Instances of this class can be used both to
 read from and to write to the resource referenced by the URL. In
 general, creating a connection to a URL is a multistep process:
 <p>
 <center><table border>
 <tr><th><code>openConnection()</code></th>
     <th><code>connect()</code></th></tr>
 <tr><td>Manipulate parameters that affect the connection to the remote
         resource.</td>
     <td>Interact with the resource; query header fields and
         contents.</td></tr>
 </table>
 ----------------------------&gt;
 <br>time</center>
 <ol>
 <li>The connection object is created by invoking the
     <code>openConnection</code> method on a URL.
 <li>The setup parameters and general request properties are manipulated.
 <li>The actual connection to the remote object is made, using the
    <code>connect</code> method.
 <li>The remote object becomes available. The header fields and the contents
     of the remote object can be accessed.
 </ol>
 <p>
 The setup parameters are modified using the following methods:
 <ul><code>
   <li>setAllowUserInteraction
   <li>setDoInput
   <li>setDoOutput
   <li>setIfModifiedSince
   <li>setUseCaches
 </code></ul>
 <p>
 and the general request properties are modified using the method:
 <ul><code>
   <li>setRequestProperty
 </code></ul>
 <p>
 Default values for the <code>AllowUserInteraction</code> and
 <code>UseCaches</code> parameters can be set using the methods
 <code>setDefaultAllowUserInteraction</code> and
 <code>setDefaultUseCaches</code>. Default values for general
 request properties can be set using the
 <code>setDefaultRequestProperty</code> method.
 <p>
 Each of the above <code>set</code> methods has a corresponding
 <code>get</code> method to retrieve the value of the parameter or
 general request property. The specific parameters and general
 request properties that are applicable are protocol specific.
 <p>
 The following methods are used to access the header fields and
 the contents after the connection is made to the remote object:
 <ul><code>
   <li>getContent
   <li>getHeaderField
   <li>getInputStream
   <li>getOutputStream
 </code></ul>
 <p>
 Certain header fields are accessed frequently. The methods:
 <ul><code>
   <li>getContentEncoding
   <li>getContentLength
   <li>getContentType
   <li>getDate
   <li>getExpiration
   <li>getLastModified
 </code></ul>
 <p>
 provide convenient access to these fields. The
 <code>getContentType</code> method is used by the
 <code>getContent</code> method to determine the type of the remote
 object; subclasses may find it convenient to override the
 <code>getContentType</code> method.
 <p>
 In the common case, all of the pre-connection parameters and
 general request properties can be ignored: the pre-connection
 parameters and request properties default to sensible values. For
 most clients of this interface, there are only two interesting
 methods: <code>getInputStream</code> and <code>getObject</code>,
 which are mirrored in the <code>URL</code> class by convenience methods.
 <p>
 More information on the request properties and header fields of
 an <code>http</code> connection can be found at:
 <ul><code>
   http://www.w3.org/hypertext/WWW/Protocols/HTTP1.0/draft-ietf-http-spec.html
 </code></ul>
 <p>
 Note about <code>fileNameMap</code>: In versions prior to JDK 1.1.6,
 field <code>fileNameMap</code> of <code>URLConnection</code> was public.
 In JDK 1.1.6 and later, <code>fileNameMap</code> is private; accessor
 method <code>getFileNameMap()</code> and mutator method
 <code>setFileNameMap(FileNameMap)</code> are added to access it.
 This change is also described on the
 <a href="http://java.sun.com/products/jdk/1.1/compatibility.html">
 JDK 1.1.x Compatibility</a> page.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.net.URL.html#openConnection()">openConnection</a>, <a href="#connect()">connect</a>, <a href="#getContent()">getContent</a>, <a href="#getContentEncoding()">getContentEncoding</a>, <a href="#getContentLength()">getContentLength</a>, <a href="#getContentType()">getContentType</a>, <a href="#getDate()">getDate</a>, <a href="#getExpiration()">getExpiration</a>, <a href="#getHeaderField(int)">getHeaderField</a>, <a href="#getHeaderField(java.lang.String)">getHeaderField</a>, <a href="#getInputStream()">getInputStream</a>, <a href="#getLastModified()">getLastModified</a>, <a href="#getOutputStream()">getOutputStream</a>, <a href="#setAllowUserInteraction(boolean)">setAllowUserInteraction</a>, <a href="#setDefaultRequestProperty(java.lang.String, java.lang.String)">setDefaultRequestProperty</a>, <a href="#setDefaultUseCaches(boolean)">setDefaultUseCaches</a>, <a href="#setDoInput(boolean)">setDoInput</a>, <a href="#setDoOutput(boolean)">setDoOutput</a>, <a href="#setIfModifiedSince(long)">setIfModifiedSince</a>, <a href="#setRequestProperty(java.lang.String, java.lang.String)">setRequestProperty</a>, <a href="#setUseCaches(boolean)">setUseCaches</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
</h2>
<dl>
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#allowUserInteraction"><b>allowUserInteraction</b></a>
  <dd>  If <code>true</code>, this <code>URL</code> is being examined in
 a context in which it makes sense to allow user interactions such
 as popping up an authentication dialog.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#connected"><b>connected</b></a>
  <dd>  If <code>false</code>, this connection object has not created a
 communications link to the specified URL.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#doInput"><b>doInput</b></a>
  <dd>  This variable is set by the <code>setDoInput</code> method.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#doOutput"><b>doOutput</b></a>
  <dd>  This variable is set by the <code>setDoOutput</code> method.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#ifModifiedSince"><b>ifModifiedSince</b></a>
  <dd>  Some protocols support skipping the fetching of the object unless
 the object has been modified more recently than a certain time.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#url"><b>url</b></a>
  <dd>  The URL represents the remote object on the World Wide Web to
 which this connection is opened.
  <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#useCaches"><b>useCaches</b></a>
  <dd>  If <code>true</code>, the protocol is allowed to use caching
 whenever it can.
</dl>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#URLConnection(java.net.URL)"><b>URLConnection</b></a>(URL)
  <dd>  Constructs a URL connection to the specified URL.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#connect()"><b>connect</b></a>()
  <dd>  Opens a communications link to the resource referenced by this
 URL, if such a connection has not already been established.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAllowUserInteraction()"><b>getAllowUserInteraction</b></a>()
  <dd>  Returns the value of the <code>allowUserInteraction</code> field for
 this object.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getContent()"><b>getContent</b></a>()
  <dd>  Retrieves the contents of this URL connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getContentEncoding()"><b>getContentEncoding</b></a>()
  <dd>  Returns the value of the <code>content-encoding</code> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getContentLength()"><b>getContentLength</b></a>()
  <dd>  Returns the value of the <code>content-length</code> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getContentType()"><b>getContentType</b></a>()
  <dd>  Returns the value of the <code>content-type</code> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDate()"><b>getDate</b></a>()
  <dd>  Returns the value of the <code>date</code> header field.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDefaultAllowUserInteraction()"><b>getDefaultAllowUserInteraction</b></a>()
  <dd>  Returns the default value of the <code>allowUserInteraction</code>
 field.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDefaultRequestProperty(java.lang.String)"><b>getDefaultRequestProperty</b></a>(String)
  <dd>  Returns the value of the default request property.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDefaultUseCaches()"><b>getDefaultUseCaches</b></a>()
  <dd>  Returns the default value of a <code>URLConnection</code>'s
 <code>useCaches</code> flag.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDoInput()"><b>getDoInput</b></a>()
  <dd>  Returns the value of this <code>URLConnection</code>'s
 <code>doInput</code> flag.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getDoOutput()"><b>getDoOutput</b></a>()
  <dd>  Returns the value of this <code>URLConnection</code>'s
 <code>doOutput</code> flag.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getExpiration()"><b>getExpiration</b></a>()
  <dd>  Returns the value of the <code>expires</code> header field.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getFileNameMap()"><b>getFileNameMap</b></a>()
  <dd>  Returns the FileNameMap.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHeaderField(int)"><b>getHeaderField</b></a>(int)
  <dd>  Returns the value for the <code>n</code><sup>th</sup> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHeaderField(java.lang.String)"><b>getHeaderField</b></a>(String)
  <dd>  Returns the value of the specified header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHeaderFieldDate(java.lang.String, long)"><b>getHeaderFieldDate</b></a>(String, long)
  <dd>  Returns the value of the named field parsed as date.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHeaderFieldInt(java.lang.String, int)"><b>getHeaderFieldInt</b></a>(String, int)
  <dd>  Returns the value of the named field parsed as a number.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getHeaderFieldKey(int)"><b>getHeaderFieldKey</b></a>(int)
  <dd>  Returns the key for the <code>n</code><sup>th</sup> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getIfModifiedSince()"><b>getIfModifiedSince</b></a>()
  <dd>  Returns the value of this object's <code>ifModifiedSince</code> field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getInputStream()"><b>getInputStream</b></a>()
  <dd>  Returns an input stream that reads from this open connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getLastModified()"><b>getLastModified</b></a>()
  <dd>  Returns the value of the <code>last-modified</code> header field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getOutputStream()"><b>getOutputStream</b></a>()
  <dd>  Returns an output stream that writes to this connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRequestProperty(java.lang.String)"><b>getRequestProperty</b></a>(String)
  <dd>  Returns the value of the named general request property for this
 connection.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getURL()"><b>getURL</b></a>()
  <dd>  Returns the value of this <code>URLConnection</code>'s <code>URL</code>
 field.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getUseCaches()"><b>getUseCaches</b></a>()
  <dd>  Returns the value of this <code>URLConnection</code>'s
 <code>useCaches</code> field.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#guessContentTypeFromName(java.lang.String)"><b>guessContentTypeFromName</b></a>(String)
  <dd>  Tries to determine the content type of an object, based
 on the specified "file" component of a URL.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#guessContentTypeFromStream(java.io.InputStream)"><b>guessContentTypeFromStream</b></a>(InputStream)
  <dd>  Tries to determine the type of an input stream based on the
 characters at the beginning of the input stream.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setAllowUserInteraction(boolean)"><b>setAllowUserInteraction</b></a>(boolean)
  <dd>  Set the value of the <code>allowUserInteraction</code> field of
 this <code>URLConnection</code>.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setContentHandlerFactory(java.net.ContentHandlerFactory)"><b>setContentHandlerFactory</b></a>(ContentHandlerFactory)
  <dd>  Sets the <code>ContentHandlerFactory</code> of an
 application.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDefaultAllowUserInteraction(boolean)"><b>setDefaultAllowUserInteraction</b></a>(boolean)
  <dd>  Sets the default value of the
 <code>allowUserInteraction</code> field for all future
 <code>URLConnection</code> objects to the specified value.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDefaultRequestProperty(java.lang.String, java.lang.String)"><b>setDefaultRequestProperty</b></a>(String, String)
  <dd>  Sets the default value of a general request property.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDefaultUseCaches(boolean)"><b>setDefaultUseCaches</b></a>(boolean)
  <dd>  Sets the default value of the <code>useCaches</code> field to the
 specified value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDoInput(boolean)"><b>setDoInput</b></a>(boolean)
  <dd>  Sets the value of the <code>doInput</code> field for this
 <code>URLConnection</code> to the specified value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setDoOutput(boolean)"><b>setDoOutput</b></a>(boolean)
  <dd>  Sets the value of the <code>doOutput</code> field for this
 <code>URLConnection</code> to the specified value.
  <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setFileNameMap(java.net.FileNameMap)"><b>setFileNameMap</b></a>(FileNameMap)
  <dd>  Sets the FileNameMap.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setIfModifiedSince(long)"><b>setIfModifiedSince</b></a>(long)
  <dd>  Sets the value of the <code>ifModifiedSince</code> field of
 this <code>URLConnection</code> to the specified value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setRequestProperty(java.lang.String, java.lang.String)"><b>setRequestProperty</b></a>(String, String)
  <dd>  Sets the general request property.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#setUseCaches(boolean)"><b>setUseCaches</b></a>(boolean)
  <dd>  Sets the value of the <code>useCaches</code> field of this
 <code>URLConnection</code> to the specified value.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#toString()"><b>toString</b></a>()
  <dd>  Returns a <code>String</code> representation of this URL connection.
</dl>
<a name="variables"></a>
<h2>
  <img src="images/variables.gif" width=153 height=38 alt="Variables">
</h2>
<a name="url"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>url</b>
<pre>
 protected <a href="java.net.URL.html#_top_">URL</a> url
</pre>
<dl>
  <dd> The URL represents the remote object on the World Wide Web to
 which this connection is opened.
 <p>
 The value of this field can be accessed by the
 <code>getURL</code> method.
 <p>
 The default value of this variable is the value of the URL
 argument in the <code>URLConnection</code> constructor.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#getURL()">getURL</a>, <a href="#url">url</a>
  </dl></dd>
</dl>
<a name="doInput"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>doInput</b>
<pre>
 protected boolean doInput
</pre>
<dl>
  <dd> This variable is set by the <code>setDoInput</code> method. Its
 value is returned by the <code>getDoInput</code> method.
 <p>
 A URL connection can be used for input and/or output. Setting the
 <code>doInput</code> flag to <code>true</code> indicates that
 the application intends to read data from the URL connection.
 <p>
 The default value of this field is <code>true</code>.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#getDoInput()">getDoInput</a>, <a href="#setDoInput(boolean)">setDoInput</a>
  </dl></dd>
</dl>
<a name="doOutput"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>doOutput</b>
<pre>
 protected boolean doOutput
</pre>
<dl>
  <dd> This variable is set by the <code>setDoOutput</code> method. Its
 value is returned by the <code>getDoInput</code> method.
 <p>
 A URL connection can be used for input and/or output. Setting the
 <code>doOutput</code> flag to <code>true</code> indicates
 that the application intends to write data to the URL connection.
 <p>
 The default value of this field is <code>false</code>.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#getDoOutput()">getDoOutput</a>, <a href="#setDoOutput(boolean)">setDoOutput</a>
  </dl></dd>
</dl>
<a name="allowUserInteraction"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>allowUserInteraction</b>
<pre>
 protected boolean allowUserInteraction
</pre>
<dl>
  <dd> If <code>true</code>, this <code>URL</code> is being examined in
 a context in which it makes sense to allow user interactions such
 as popping up an authentication dialog. If <code>false</code>,
 then no user interaction is allowed.
 <p>
 The value of this field can be set by the
 <code>setAllowUserInteraction</code> method.
 Its value is returned by the
 <code>getAllowUserInteraction</code> method.
 Its default value is the value of the argument in the last invocation
 of the <code>setDefaultAllowUserInteraction</code> method.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#getAllowUserInteraction()">getAllowUserInteraction</a>, <a href="#setAllowUserInteraction(boolean)">setAllowUserInteraction</a>, <a href="#setDefaultAllowUserInteraction(boolean)">setDefaultAllowUserInteraction</a>
  </dl></dd>
</dl>
<a name="useCaches"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>useCaches</b>
<pre>
 protected boolean useCaches
</pre>
<dl>
  <dd> If <code>true</code>, the protocol is allowed to use caching
 whenever it can. If <code>false</code>, the protocol must always
 try to get a fresh copy of the object.
 <p>
 This field is set by the <code>setUseCaches</code> method. Its
 value is returned by the <code>getUseCaches</code> method.
 <p>
 Its default value is the value given in the last invocation of the
 <code>setDefaultUseCaches</code> method.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#setUseCaches(boolean)">setUseCaches</a>, <a href="#getUseCaches()">getUseCaches</a>, <a href="#setDefaultUseCaches(boolean)">setDefaultUseCaches</a>
  </dl></dd>
</dl>
<a name="ifModifiedSince"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>ifModifiedSince</b>
<pre>
 protected long ifModifiedSince
</pre>
<dl>
  <dd> Some protocols support skipping the fetching of the object unless
 the object has been modified more recently than a certain time.
 <p>
 A nonzero value gives a time as the number of seconds since
 January 1, 1970, GMT. The object is fetched only if it has been
 modified more recently than that time.
 <p>
 This variable is set by the <code>setIfModifiedSince</code>
 method. Its value is returned by the
 <code>getIfModifiedSince</code> method.
 <p>
 The default value of this field is <code>0</code>, indicating
 that the fetching must always occur.<p>
  <dd><dl> 
    <dt> <b>See Also:</b>
    <dd> <a href="#getIfModifiedSince()">getIfModifiedSince</a>, <a href="#setIfModifiedSince(long)">setIfModifiedSince</a>
  </dl></dd>
</dl>
<a name="connected"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
<b>connected</b>
<pre>
 protected boolean connected
</pre>
<dl>
  <dd> If <code>false</code>, this connection object has not created a
 communications link to the specified URL. If <code>true</code>,
 the communications link has been established.<p>
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="URLConnection"></a>
<a name="URLConnection(java.net.URL)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>URLConnection</b>
<pre>
 protected URLConnection(<a href="java.net.URL.html#_top_">URL</a> url)
</pre>
<dl>
  <dd> Constructs a URL connection to the specified URL. A connection to
 the object referenced by the URL is not created.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> url - the specified URL.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getFileNameMap()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getFileNameMap"><b>getFileNameMap</b></a>
<pre>
 public static <a href="java.net.FileNameMap.html#_top_">FileNameMap</a> getFileNameMap()
</pre>
<dl>
  <dd> Returns the FileNameMap.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> s	the FileNameMap
  </dl></dd>
</dl>
<a name="setFileNameMap(java.net.FileNameMap)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setFileNameMap"><b>setFileNameMap</b></a>
<pre>
 public static void setFileNameMap(<a href="java.net.FileNameMap.html#_top_">FileNameMap</a> map)
</pre>
<dl>
  <dd> Sets the FileNameMap.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> map - the FileNameMap to be set
  </dl></dd>
</dl>
<a name="connect()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="connect"><b>connect</b></a>
<pre>
 public abstract void connect() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Opens a communications link to the resource referenced by this
 URL, if such a connection has not already been established.
 <p>
 If the <code>connect</code> method is called when the connection
 has already been opened (indicated by the <code>connected</code>
 field having the value <code>true</code>), the call is ignored.
 <p>
 URLConnection objects go through two phases: first they are
 created, then they are connected.  After being created, and
 before being connected, various options can be specified
 (e.g., doInput and UseCaches).  After connecting, it is an
 error to try to set them.  Operations that depend on being
 connected, like getContentLength, will implicitly perform the
 connection, if necessary.
<p>
  <dd><dl>
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while opening the
               connection.
    <dt> <b>See Also:</b>
    <dd> <a href="#connected">connected</a>
  </dl></dd>
</dl>
<a name="getURL()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getURL"><b>getURL</b></a>
<pre>
 public <a href="java.net.URL.html#_top_">URL</a> getURL()
</pre>
<dl>
  <dd> Returns the value of this <code>URLConnection</code>'s <code>URL</code>
 field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of this <code>URLConnection</code>'s <code>URL</code>
          field.
    <dt> <b>See Also:</b>
    <dd> <a href="#url">url</a>
  </dl></dd>
</dl>
<a name="getContentLength()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getContentLength"><b>getContentLength</b></a>
<pre>
 public int getContentLength()
</pre>
<dl>
  <dd> Returns the value of the <code>content-length</code> header field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the content length of the resource that this connection's URL
          references, or <code>-1</code> if the content length is
          not known.
  </dl></dd>
</dl>
<a name="getContentType()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getContentType"><b>getContentType</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getContentType()
</pre>
<dl>
  <dd> Returns the value of the <code>content-type</code> header field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the content type of the resource that the URL references,
          or <code>null</code> if not known.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderField(java.lang.String)">getHeaderField</a>
  </dl></dd>
</dl>
<a name="getContentEncoding()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getContentEncoding"><b>getContentEncoding</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getContentEncoding()
</pre>
<dl>
  <dd> Returns the value of the <code>content-encoding</code> header field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the content encoding of the resource that the URL references,
          or <code>null</code> if not known.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderField(java.lang.String)">getHeaderField</a>
  </dl></dd>
</dl>
<a name="getExpiration()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getExpiration"><b>getExpiration</b></a>
<pre>
 public long getExpiration()
</pre>
<dl>
  <dd> Returns the value of the <code>expires</code> header field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the expiration date of the resource that this URL references,
          or 0 if not known. The value is the number of seconds since
          January 1, 1970 GMT.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderField(java.lang.String)">getHeaderField</a>
  </dl></dd>
</dl>
<a name="getDate()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDate"><b>getDate</b></a>
<pre>
 public long getDate()
</pre>
<dl>
  <dd> Returns the value of the <code>date</code> header field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the sending date of the resource that the URL references,
          or <code>0</code> if not known. The value returned is the
          number of seconds since January 1, 1970 GMT.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderField(java.lang.String)">getHeaderField</a>
  </dl></dd>
</dl>
<a name="getLastModified()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getLastModified"><b>getLastModified</b></a>
<pre>
 public long getLastModified()
</pre>
<dl>
  <dd> Returns the value of the <code>last-modified</code> header field.
 The result is the number of seconds since January 1, 1970 GMT.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the date the resource referenced by this
          <code>URLConnection</code> was last modified, or 0 if not known.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderField(java.lang.String)">getHeaderField</a>
  </dl></dd>
</dl>
<a name="getHeaderField(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHeaderField"><b>getHeaderField</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getHeaderField(<a href="java.lang.String.html#_top_">String</a> name)
</pre>
<dl>
  <dd> Returns the value of the specified header field. Names of
 header fields to pass to this method can be obtained from
 getHeaderFieldKey.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of a header field.
    <dt> <b>Returns:</b>
    <dd> the value of the named header field, or <code>null</code>
          if there is no such field in the header.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderFieldKey(int)">getHeaderFieldKey</a>
  </dl></dd>
</dl>
<a name="getHeaderFieldInt(java.lang.String, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHeaderFieldInt"><b>getHeaderFieldInt</b></a>
<pre>
 public int getHeaderFieldInt(<a href="java.lang.String.html#_top_">String</a> name,
                              int Default)
</pre>
<dl>
  <dd> Returns the value of the named field parsed as a number.
 <p>
 This form of <code>getHeaderField</code> exists because some
 connection types (e.g., <code>http-ng</code>) have pre-parsed
 headers. Classes for that connection type can override this method
 and short-circuit the parsing.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the header field.
    <dd> Default - the default value.
    <dt> <b>Returns:</b>
    <dd> the value of the named field, parsed as an integer. The
          <code>Default</code> value is returned if the field is
          missing or malformed.
  </dl></dd>
</dl>
<a name="getHeaderFieldDate(java.lang.String, long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHeaderFieldDate"><b>getHeaderFieldDate</b></a>
<pre>
 public long getHeaderFieldDate(<a href="java.lang.String.html#_top_">String</a> name,
                                long Default)
</pre>
<dl>
  <dd> Returns the value of the named field parsed as date.
 The result is the number of seconds since January 1, 1970 GMT
 represented by the named field.
 <p>
 This form of <code>getHeaderField</code> exists because some
 connection types (e.g., <code>http-ng</code>) have pre-parsed
 headers. Classes for that connection type can override this method
 and short-circuit the parsing.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> name - the name of the header field.
    <dd> Default - a default value.
    <dt> <b>Returns:</b>
    <dd> the value of the field, parsed as a date. The value of the
          <code>Default</code> argument is returned if the field is
          missing or malformed.
  </dl></dd>
</dl>
<a name="getHeaderFieldKey(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHeaderFieldKey"><b>getHeaderFieldKey</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getHeaderFieldKey(int n)
</pre>
<dl>
  <dd> Returns the key for the <code>n</code><sup>th</sup> header field.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> n - an index.
    <dt> <b>Returns:</b>
    <dd> the key for the <code>n</code><sup>th</sup> header field,
          or <code>null</code> if there are fewer than <code>n</code>
          fields.
  </dl></dd>
</dl>
<a name="getHeaderField(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getHeaderField"><b>getHeaderField</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getHeaderField(int n)
</pre>
<dl>
  <dd> Returns the value for the <code>n</code><sup>th</sup> header field.
 It returns <code>null</code> if there are fewer than
 <code>n</code> fields.
 <p>
 This method can be used in conjunction with the
 <code>getHeaderFieldKey</code> method to iterate through all
 the headers in the message.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> n - an index.
    <dt> <b>Returns:</b>
    <dd> the value of the <code>n</code><sup>th</sup> header field.
    <dt> <b>See Also:</b>
    <dd> <a href="#getHeaderFieldKey(int)">getHeaderFieldKey</a>
  </dl></dd>
</dl>
<a name="getContent()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getContent"><b>getContent</b></a>
<pre>
 public <a href="java.lang.Object.html#_top_">Object</a> getContent() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Retrieves the contents of this URL connection.
 <p>
 This method first determines the content type of the object by
 calling the <code>getContentType</code> method. If this is
 the first time that the application has seen that specific content
 type, a content handler for that content type is created:
 <ol>
 <li>If the application has set up a content handler factory instance
     using the <code>setContentHandlerFactory</code> method, the
     <code>createContentHandler</code> method of that instance is called
     with the content type as an argument; the result is a content
     handler for that content type.
 <li>If no content handler factory has yet been set up, or if the
     factory's <code>createContentHandler</code> method returns
     <code>null</code>, then the application loads the class named:
     <ul><code>
         sun.net.www.content.&lt;<i>contentType</i>&gt;
     </code></ul>
     where &lt;<i>contentType</i>&gt; is formed by taking the
     content-type string, replacing all slash characters with a
     <code>period</code> ('.'), and all other non-alphanumeric characters
     with the underscore character '<code>_</code>'. The alphanumeric
     characters are specifically the 26 uppercase ASCII letters
     '<code>A</code>' through '<code>Z</code>', the 26 lowercase ASCII
     letters '<code>a</code>' through '<code>z</code>', and the 10 ASCII
     digits '<code>0</code>' through '<code>9</code>'. If the specified
     class does not exist, or is not a subclass of
     <code>ContentHandler</code>, then an
     <code>UnknownServiceException</code> is thrown.
 </ol>
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the object fetched. The <code>instanceOf</code> operation
               should be used to determine the specific kind of object
               returned.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while
               getting the content.
    <dt> <b>Throws:</b> <a href="java.net.UnknownServiceException.html#_top_">UnknownServiceException</a>
    <dd> if the protocol does not support
               the content type.
    <dt> <b>See Also:</b>
    <dd> <a href="java.net.ContentHandlerFactory.html#createContentHandler(java.lang.String)">createContentHandler</a>, <a href="#getContentType()">getContentType</a>, <a href="#setContentHandlerFactory(java.net.ContentHandlerFactory)">setContentHandlerFactory</a>
  </dl></dd>
</dl>
<a name="getInputStream()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getInputStream"><b>getInputStream</b></a>
<pre>
 public <a href="java.io.InputStream.html#_top_">InputStream</a> getInputStream() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns an input stream that reads from this open connection.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an input stream that reads from this open connection.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while
               creating the input stream.
    <dt> <b>Throws:</b> <a href="java.net.UnknownServiceException.html#_top_">UnknownServiceException</a>
    <dd> if the protocol does not support
               input.
  </dl></dd>
</dl>
<a name="getOutputStream()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getOutputStream"><b>getOutputStream</b></a>
<pre>
 public <a href="java.io.OutputStream.html#_top_">OutputStream</a> getOutputStream() throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Returns an output stream that writes to this connection.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> an output stream that writes to this connection.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while
               creating the output stream.
    <dt> <b>Throws:</b> <a href="java.net.UnknownServiceException.html#_top_">UnknownServiceException</a>
    <dd> if the protocol does not support
               output.
  </dl></dd>
</dl>
<a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="toString"><b>toString</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> toString()
</pre>
<dl>
  <dd> Returns a <code>String</code> representation of this URL connection.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> a string representation of this <code>URLConnection</code>.
    <dt> <b>Overrides:</b>
    <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  </dl></dd>
</dl>
<a name="setDoInput(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDoInput"><b>setDoInput</b></a>
<pre>
 public void setDoInput(boolean doinput)
</pre>
<dl>
  <dd> Sets the value of the <code>doInput</code> field for this
 <code>URLConnection</code> to the specified value.
 <p>
 A URL connection can be used for input and/or output.  Set the DoInput
 flag to true if you intend to use the URL connection for input,
 false if not.  The default is true unless DoOutput is explicitly
 set to true, in which case DoInput defaults to false.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> value - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#doInput">doInput</a>
  </dl></dd>
</dl>
<a name="getDoInput()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDoInput"><b>getDoInput</b></a>
<pre>
 public boolean getDoInput()
</pre>
<dl>
  <dd> Returns the value of this <code>URLConnection</code>'s
 <code>doInput</code> flag.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of this <code>URLConnection</code>'s
          <code>doInput</code> flag.
    <dt> <b>See Also:</b>
    <dd> <a href="#doInput">doInput</a>
  </dl></dd>
</dl>
<a name="setDoOutput(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDoOutput"><b>setDoOutput</b></a>
<pre>
 public void setDoOutput(boolean dooutput)
</pre>
<dl>
  <dd> Sets the value of the <code>doOutput</code> field for this
 <code>URLConnection</code> to the specified value.
 <p>
 A URL connection can be used for input and/or output.  Set the DoOutput
 flag to true if you intend to use the URL connection for output,
 false if not.  The default is false.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> value - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#doOutput">doOutput</a>
  </dl></dd>
</dl>
<a name="getDoOutput()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDoOutput"><b>getDoOutput</b></a>
<pre>
 public boolean getDoOutput()
</pre>
<dl>
  <dd> Returns the value of this <code>URLConnection</code>'s
 <code>doOutput</code> flag.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of this <code>URLConnection</code>'s
          <code>doOutput</code> flag.
    <dt> <b>See Also:</b>
    <dd> <a href="#doOutput">doOutput</a>
  </dl></dd>
</dl>
<a name="setAllowUserInteraction(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setAllowUserInteraction"><b>setAllowUserInteraction</b></a>
<pre>
 public void setAllowUserInteraction(boolean allowuserinteraction)
</pre>
<dl>
  <dd> Set the value of the <code>allowUserInteraction</code> field of
 this <code>URLConnection</code>.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> allowuserinteraction - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#allowUserInteraction">allowUserInteraction</a>
  </dl></dd>
</dl>
<a name="getAllowUserInteraction()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAllowUserInteraction"><b>getAllowUserInteraction</b></a>
<pre>
 public boolean getAllowUserInteraction()
</pre>
<dl>
  <dd> Returns the value of the <code>allowUserInteraction</code> field for
 this object.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of the <code>allowUserInteraction</code> field for
          this object.
    <dt> <b>See Also:</b>
    <dd> <a href="#allowUserInteraction">allowUserInteraction</a>
  </dl></dd>
</dl>
<a name="setDefaultAllowUserInteraction(boolean)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDefaultAllowUserInteraction"><b>setDefaultAllowUserInteraction</b></a>
<pre>
 public static void setDefaultAllowUserInteraction(boolean defaultallowuserinteraction)
</pre>
<dl>
  <dd> Sets the default value of the
 <code>allowUserInteraction</code> field for all future
 <code>URLConnection</code> objects to the specified value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> defaultallowuserinteraction - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#allowUserInteraction">allowUserInteraction</a>
  </dl></dd>
</dl>
<a name="getDefaultAllowUserInteraction()"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDefaultAllowUserInteraction"><b>getDefaultAllowUserInteraction</b></a>
<pre>
 public static boolean getDefaultAllowUserInteraction()
</pre>
<dl>
  <dd> Returns the default value of the <code>allowUserInteraction</code>
 field.
 <p>
 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.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the default value of the <code>allowUserInteraction</code>
          field.
    <dt> <b>See Also:</b>
    <dd> <a href="#allowUserInteraction">allowUserInteraction</a>
  </dl></dd>
</dl>
<a name="setUseCaches(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setUseCaches"><b>setUseCaches</b></a>
<pre>
 public void setUseCaches(boolean usecaches)
</pre>
<dl>
  <dd> Sets the value of the <code>useCaches</code> field of this
 <code>URLConnection</code> to the specified value.
 <p>
 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.
<p>
  <dd><dl>
    <dt> <b>See Also:</b>
    <dd> <a href="#useCaches">useCaches</a>
  </dl></dd>
</dl>
<a name="getUseCaches()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getUseCaches"><b>getUseCaches</b></a>
<pre>
 public boolean getUseCaches()
</pre>
<dl>
  <dd> Returns the value of this <code>URLConnection</code>'s
 <code>useCaches</code> field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of this <code>URLConnection</code>'s
          <code>useCaches</code> field.
    <dt> <b>See Also:</b>
    <dd> <a href="#useCaches">useCaches</a>
  </dl></dd>
</dl>
<a name="setIfModifiedSince(long)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setIfModifiedSince"><b>setIfModifiedSince</b></a>
<pre>
 public void setIfModifiedSince(long ifmodifiedsince)
</pre>
<dl>
  <dd> Sets the value of the <code>ifModifiedSince</code> field of
 this <code>URLConnection</code> to the specified value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> value - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#ifModifiedSince">ifModifiedSince</a>
  </dl></dd>
</dl>
<a name="getIfModifiedSince()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getIfModifiedSince"><b>getIfModifiedSince</b></a>
<pre>
 public long getIfModifiedSince()
</pre>
<dl>
  <dd> Returns the value of this object's <code>ifModifiedSince</code> field.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of this object's <code>ifModifiedSince</code> field.
    <dt> <b>See Also:</b>
    <dd> <a href="#ifModifiedSince">ifModifiedSince</a>
  </dl></dd>
</dl>
<a name="getDefaultUseCaches()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDefaultUseCaches"><b>getDefaultUseCaches</b></a>
<pre>
 public boolean getDefaultUseCaches()
</pre>
<dl>
  <dd> Returns the default value of a <code>URLConnection</code>'s
 <code>useCaches</code> flag.
 <p>
 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.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the default value of a <code>URLConnection</code>'s
          <code>useCaches</code> flag.
    <dt> <b>See Also:</b>
    <dd> <a href="#useCaches">useCaches</a>
  </dl></dd>
</dl>
<a name="setDefaultUseCaches(boolean)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDefaultUseCaches"><b>setDefaultUseCaches</b></a>
<pre>
 public void setDefaultUseCaches(boolean defaultusecaches)
</pre>
<dl>
  <dd> Sets the default value of the <code>useCaches</code> field to the
 specified value.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> defaultusecaches - the new value.
    <dt> <b>See Also:</b>
    <dd> <a href="#useCaches">useCaches</a>
  </dl></dd>
</dl>
<a name="setRequestProperty(java.lang.String, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setRequestProperty"><b>setRequestProperty</b></a>
<pre>
 public void setRequestProperty(<a href="java.lang.String.html#_top_">String</a> key,
                                <a href="java.lang.String.html#_top_">String</a> value)
</pre>
<dl>
  <dd> Sets the general request property.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the keyword by which the request is known
                  (e.g., "<code>accept</code>").
    <dd> value - the value associated with it.
  </dl></dd>
</dl>
<a name="getRequestProperty(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRequestProperty"><b>getRequestProperty</b></a>
<pre>
 public <a href="java.lang.String.html#_top_">String</a> getRequestProperty(<a href="java.lang.String.html#_top_">String</a> key)
</pre>
<dl>
  <dd> Returns the value of the named general request property for this
 connection.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of the named general request property for this
           connection.
  </dl></dd>
</dl>
<a name="setDefaultRequestProperty(java.lang.String, java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setDefaultRequestProperty"><b>setDefaultRequestProperty</b></a>
<pre>
 public static void setDefaultRequestProperty(<a href="java.lang.String.html#_top_">String</a> key,
                                              <a href="java.lang.String.html#_top_">String</a> value)
</pre>
<dl>
  <dd> Sets the default value of a general request property. When a
 <code>URLConnection</code> is created, it is initialized with
 these properties.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> key - the keyword by which the request is known
                  (e.g., "<code>accept</code>").
    <dd> value - the value associated with the key.
  </dl></dd>
</dl>
<a name="getDefaultRequestProperty(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getDefaultRequestProperty"><b>getDefaultRequestProperty</b></a>
<pre>
 public static <a href="java.lang.String.html#_top_">String</a> getDefaultRequestProperty(<a href="java.lang.String.html#_top_">String</a> key)
</pre>
<dl>
  <dd> Returns the value of the default request property. Default request
 properties are set for every connection.
<p>
  <dd><dl>
    <dt> <b>Returns:</b>
    <dd> the value of the default request property for the specified key.
    <dt> <b>See Also:</b>
    <dd> <a href="#setDefaultRequestProperty(java.lang.String, java.lang.String)">setDefaultRequestProperty</a>
  </dl></dd>
</dl>
<a name="setContentHandlerFactory(java.net.ContentHandlerFactory)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="setContentHandlerFactory"><b>setContentHandlerFactory</b></a>
<pre>
 public static synchronized void setContentHandlerFactory(<a href="java.net.ContentHandlerFactory.html#_top_">ContentHandlerFactory</a> fac)
</pre>
<dl>
  <dd> Sets the <code>ContentHandlerFactory</code> of an
 application. It can be called at most once by an application.
 <p>
 The <code>ContentHandlerFactory</code> instance is used to
 construct a content handler from a content type
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> fac - the desired factory.
    <dt> <b>Throws:</b> <a href="java.lang.Error.html#_top_">Error</a>
    <dd> if the factory has already been defined.
    <dt> <b>See Also:</b>
    <dd> <a href="java.net.ContentHandlerFactory.html#_top_">ContentHandlerFactory</a>, <a href="#getContent()">getContent</a>
  </dl></dd>
</dl>
<a name="guessContentTypeFromName(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="guessContentTypeFromName"><b>guessContentTypeFromName</b></a>
<pre>
 protected static <a href="java.lang.String.html#_top_">String</a> guessContentTypeFromName(<a href="java.lang.String.html#_top_">String</a> fname)
</pre>
<dl>
  <dd> Tries to determine the content type of an object, based
 on the specified "file" component of a URL.
 This is a convenience method that can be used by
 subclasses that override the <code>getContentType</code> method.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> fname - a filename.
    <dt> <b>Returns:</b>
    <dd> a guess as to what the content type of the object is,
          based upon its file name.
    <dt> <b>See Also:</b>
    <dd> <a href="#getContentType()">getContentType</a>
  </dl></dd>
</dl>
<a name="guessContentTypeFromStream(java.io.InputStream)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
<a name="guessContentTypeFromStream"><b>guessContentTypeFromStream</b></a>
<pre>
 public static <a href="java.lang.String.html#_top_">String</a> guessContentTypeFromStream(<a href="java.io.InputStream.html#_top_">InputStream</a> is) throws <a href="java.io.IOException.html#_top_">IOException</a>
</pre>
<dl>
  <dd> Tries to determine the type of an input stream based on the
 characters at the beginning of the input stream. This method can
 be used by subclasses that override the
 <code>getContentType</code> method.
 <p>
 Ideally, this routine would not be needed. But many
 <code>http</code> servers return the incorrect content type; in
 addition, there are many nonstandard extensions. Direct inspection
 of the bytes to determine the content type is often more accurate
 than believing the content type claimed by the <code>http</code> server.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> is - an input stream that supports marks.
    <dt> <b>Returns:</b>
    <dd> a guess at the content type, or <code>null</code> if none
             can be determined.
    <dt> <b>Throws:</b> <a href="java.io.IOException.html#_top_">IOException</a>
    <dd> if an I/O error occurs while reading the
               input stream.
    <dt> <b>See Also:</b>
    <dd> <a href="java.io.InputStream.html#mark(int)">mark</a>, <a href="java.io.InputStream.html#markSupported()">markSupported</a>, <a href="#getContentType()">getContentType</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.net.html">This Package</a>  <a href="java.net.URL.html#_top_">Previous</a>  <a href="java.net.URLEncoder.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
