All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Acme.PostURLConnection

java.lang.Object
   |
   +----Acme.PostURLConnection

public class PostURLConnection
extends Object
A URLConnection that implements POST.

Some implementations of URLConnection, e.g. the one in Navigator 3.0, do not support POST. This is a stripped-down version that does.

Note that it can't inherit from java.net.URLConnection because that class has no public constructors. Not all the standard URLConnection methods are re-implemented here, just the ones necessary for posting.

This class is not needed in current browsers.

Fetch the software.
Fetch the entire Acme package.


Constructor Index

 o PostURLConnection(URL)
Constructs a POST URL connection to the specified URL.

Method Index

 o close()
 o connect()
 o getContentLength()
 o getContentType()
Gets the content type.
 o getDoInput()
 o getDoOutput()
 o getHeaderField(String)
Gets a header field by name.
 o getHeaderFieldDate(String, long)
Gets a header field by name.
 o getHeaderFieldInt(String, int)
Gets a header field by name.
 o getInputStream()
Call this routine to get an InputStream that reads from the object.
 o getOutputStream()
Call this routine to get an OutputStream that writes to the object.
 o getRequestProperty(String)
 o getURL()
Gets the URL for this connection.
 o getUseCaches()
 o setDoInput(boolean)
A URL connection can be used for input and/or output.
 o setDoOutput(boolean)
A URL connection can be used for input and/or output.
 o setRequestProperty(String, String)
 o setUseCaches(boolean)
Some protocols do caching of documents.
 o toString()
Returns the String representation of the URL connection.

Constructors

 o PostURLConnection
 public PostURLConnection(URL url)
Constructs a POST URL connection to the specified URL.

Parameters:
url - the specified URL

Methods

 o connect
 public void connect() throws IOException
 o close
 public void close() throws IOException
 o getURL
 public URL getURL()
Gets the URL for this connection.

 o getContentLength
 public int getContentLength() throws IOException
 o getContentType
 public String getContentType() throws IOException
Gets the content type. Returns null if not known.

 o getHeaderField
 public String getHeaderField(String name) throws IOException
Gets a header field by name. Returns null if not known.

Parameters:
name - the name of the header field
 o getHeaderFieldInt
 public int getHeaderFieldInt(String name,
                              int def) throws IOException
Gets a header field by name. Returns null if not known. The field is parsed as an integer.

Parameters:
name - the name of the header field
def - the value to return if the field is missing or malformed.
 o getHeaderFieldDate
 public long getHeaderFieldDate(String name,
                                long def) throws IOException
Gets a header field by name. Returns null if not known. The field is parsed as a date.

Parameters:
name - the name of the header field
def - the value to return if the field is missing or malformed.
 o getInputStream
 public InputStream getInputStream() throws IOException
Call this routine to get an InputStream that reads from the object.

Throws: UnknownServiceException
If the protocol does not support input.
 o getOutputStream
 public OutputStream getOutputStream() throws IOException
Call this routine to get an OutputStream that writes to the object.

Throws: UnknownServiceException
If the protocol does not support output.
 o toString
 public String toString()
Returns the String representation of the URL connection.

Overrides:
toString in class Object
 o setDoInput
 public void setDoInput(boolean doInput)
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 for PostURLConnections is false.

 o getDoInput
 public boolean getDoInput()
 o setDoOutput
 public void setDoOutput(boolean doOutput)
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 for PostURLConnections is true.

 o getDoOutput
 public boolean getDoOutput()
 o setUseCaches
 public void setUseCaches(boolean useCaches)
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 for PostURLConnections is false.

 o getUseCaches
 public boolean getUseCaches()
 o setRequestProperty
 public void setRequestProperty(String name,
                                String value)
 o getRequestProperty
 public String getRequestProperty(String name)

All Packages  Class Hierarchy  This Package  Previous  Next  Index

ACME Java  ACME Labs