2002-09-25 Michael Koch <konqueror@gmx.de>
* java/net/DatagramSocket.java (DatagramSocket): Exception documentation added. (bind): Exception documentation added, addded SecurityManager check, added SocketAddress type check. (getSoTimeout): Check impl. (receive): Fix SecurityManager check, check impl, documentation added. (send): Check channel mode, documentation added. (connect): New method. (disconnect): Implemented. (getLocalSocketAddress): New method. (getReceiveBufferSize): Check impl. (setReuseAddress): Check impl. (getReuseAddress): Check impl. (setBroadcast): Check impl. (getBroadcast): Check impl. (setTrafficClass): Check impl, Documentation cleared. (getTrafficClass): Check impl. (getSendBufferSize): Check impl. (setReceiveBufferSize): Check impl, documentation added. (setSendBufferSize): Documentation added. (setDatagramSocketImplFactory): New method. * java/net/HttpURLConnection.java (HTTP_INTERNAL_ERROR): The correct code is 500. (HTTP_NOT_IMPLEMENTED): Added new constant. (setFollowRedirects): Documentation added. (getInstanceFollowRedirects): New method. (setInstanceFollowRedirects): New method. (setRequestMethod): Documentation added. (getResponseCode): Documentation added. (getResponseMessage): Documentation added. * java/net/JarURLConnection.java (JarURLConnection): protected since JDK 1.4. (getJarEntry): java.io.IOException to IOException, documentation added. (getJarFile): Documentation added. * java/net/ServerSocket.java (ServerSocket): Private to public, exception added. (ServerSocket): java.io.IOException to IOException, documentation added. (bind): Check socket address type, documentation added. (bind): java.io.IOException to IOException, documentation added. (accept): Documentation added. (implAccept): Check ch is not non-blocking, documentation added. (setSoTimeout): Documentation fixed. (setReceiveBufferSize): Documentation added. * java/net/Socket.java (Socket): Documentation added. (bind): Documentation added. (connect): Check socket address type, documentation added. (getRemoteSocketAddress): New method. From-SVN: r57494
This commit is contained in:
parent
33c31b33b5
commit
df79dc1a89
10 changed files with 601 additions and 28 deletions
|
@ -12,6 +12,7 @@ details. */
|
|||
package java.net;
|
||||
|
||||
import java.io.*;
|
||||
import java.security.Permission;
|
||||
|
||||
/**
|
||||
* @author Warren Levy <warrenl@cygnus.com>
|
||||
|
@ -64,7 +65,8 @@ public abstract class HttpURLConnection extends URLConnection
|
|||
|
||||
/* HTTP Server Error Response Codes */
|
||||
public static final int HTTP_SERVER_ERROR = 500;
|
||||
public static final int HTTP_INTERNAL_ERROR = 501;
|
||||
public static final int HTTP_INTERNAL_ERROR = 500;
|
||||
public static final int HTTP_NOT_IMPLEMENTED = 501;
|
||||
public static final int HTTP_BAD_GATEWAY = 502;
|
||||
public static final int HTTP_UNAVAILABLE = 503;
|
||||
public static final int HTTP_GATEWAY_TIMEOUT = 504;
|
||||
|
@ -88,6 +90,13 @@ public abstract class HttpURLConnection extends URLConnection
|
|||
|
||||
public abstract boolean usingProxy();
|
||||
|
||||
/**
|
||||
* Sets whether HTTP redirects (requests with response code 3xx) should be
|
||||
* automatically followed by this class. True by default
|
||||
*
|
||||
* @exception SecurityException If a security manager exists and its
|
||||
* checkSetFactory method doesn't allow the operation
|
||||
*/
|
||||
public static void setFollowRedirects(boolean set)
|
||||
{
|
||||
// Throw an exception if an extant security mgr precludes
|
||||
|
@ -104,6 +113,30 @@ public abstract class HttpURLConnection extends URLConnection
|
|||
return followRedirects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this HttpURLConnection's instanceFollowRedirects
|
||||
* field
|
||||
*/
|
||||
public boolean getInstanceFollowRedirects ()
|
||||
{
|
||||
return instanceFollowRedirects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of this HttpURLConnection's instanceFollowRedirects field
|
||||
*/
|
||||
public void setInstanceFollowRedirects (boolean follow)
|
||||
{
|
||||
instanceFollowRedirects = follow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the method for the URL request, one of:
|
||||
* GET POST HEAD OPTIONS PUT DELETE TRACE are legal
|
||||
*
|
||||
* @exception ProtocolException If the method cannot be reset or if the
|
||||
* requested method isn't valid for HTTP
|
||||
*/
|
||||
public void setRequestMethod(String method) throws ProtocolException
|
||||
{
|
||||
if (connected)
|
||||
|
@ -123,6 +156,11 @@ public abstract class HttpURLConnection extends URLConnection
|
|||
return method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status code from an HTTP response message
|
||||
*
|
||||
* @exception IOException If an error occurs
|
||||
*/
|
||||
public int getResponseCode() throws IOException
|
||||
{
|
||||
if (!gotResponseVals)
|
||||
|
@ -130,6 +168,12 @@ public abstract class HttpURLConnection extends URLConnection
|
|||
return responseCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP response message, if any, returned along with the
|
||||
* response code from a server
|
||||
*
|
||||
* @exception IOException If an error occurs
|
||||
*/
|
||||
public String getResponseMessage() throws IOException
|
||||
{
|
||||
if (!gotResponseVals)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue