java.net.DatagramSocketImplFactory New interface [java.net.DatagramSocketImplFactory](../../../api/java/net/DatagramSocketImplFactory.html)is used by [DatagramSocket](../../../api/java/net/DatagramSocket.html)to create actual socket implementations. This addition makes DatagramSocket consistent with the other socket types, by allowing the user to set the DatagramSocketImplFactory through a public API.
Modified Classes/Interfaces
java.net.HttpURLConnection The following constants were added to [java.net.HttpURLConnection](../../../api/java/net/HttpURLConnection.html)to make the HTTP status codes match the HTTP 1.1 RFC:
public static final int HTTP_INTERNAL_ERROR = 500;
public static final int HTTP_NOT_IMPLEMENTED = 501; Two new methods were added to support following HTTP redirects (requests with response code 3xx) on a per-instance basis. The default is to use the class setting.
java.net.Socket andjava.net.SocketImpl Two new methods have been added to [java.net.Socket](../../../api/java/net/Socket.html).Java sockets now support the keepalive option.
[public void setKeepAlive(boolean on)](../../../api/java/net/Socket.html#setKeepAlive-boolean-) Two new methods have been added to [java.net.Socket](../../../api/java/net/Socket.html) and[java.net.SocketImpl](../../../api/java/net/SocketImpl.html).This change is to support TCP half-closed sockets:
public void shutdownInput()
public void shutdownOutput()
java.net.URL,java.net.URLConnection, andjava.net.ContentHandler Several access methods have been added to make [java.net.URL](../../../api/java/net/URL.html) consistent with the fields of a URL as described in the latest IETF specification, RFC2396.
[public String getUserInfo()](../../../api/java/net/URL.html#getUserInfo--) An overloaded getContent() method was added to[java.net.URL](../../../api/java/net/URL.html),[java.net.URLConnection](../../../api/java/net/URLConnection.html),and [java.net.ContentHandler](../../../api/java/net/ContentHandler.html)to allow requesting that the returned content object support one of an ordered list of Java types. This allows mapping of MIME types to more than one possible Java type, and improves system flexibility. varied implementation, see javadocs for each class. Static methods [java.net.URLConnection.setDefaultRequestProperty()](../../../api/java/net/URLConnection.html#setDefaultRequestProperty-java.lang.String-java.lang.String-) and[java.net.URLConnection.getDefaultRequestProperty()](../../../api/java/net/URLConnection.html#getDefaultRequestProperty-java.lang.String-) are now deprecated.
java.net.URLDecoder The method [java.net.URLDecoder.decode(String)](../../../api/java/net/URLDecoder.html#decode-java.lang.String-)no longer throws an exception.
java.net.URLStreamHandler Several new methods have been added to [java.net.URLStreamHandler](../../../api/java/net/URLStreamHandler.html). These additions expose the concept of a handler's default port number and allow URL handlers to override aspects of URL equality and hashcode comparisons in URL protocol-specific ways. These changes enable cleaner access to the parsed component parts of a URL and enhance the ability of the various URL handlers to share common parsing code.
[protected void setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref)](../../../api/java/net/URLStreamHandler.html#setURL-java.net.URL-java.lang.String-java.lang.String-int-java.lang.String-java.lang.String-java.lang.String-java.lang.String-java.lang.String-)
java.util.jar.JarFile andjava.util.zip.ZipFile There is a new open mode for [java.util.zip.ZipFile](../../../api/java/util/zip/ZipFile.html)and [java.util.jar.JarFile](../../../api/java/util/jar/JarFile.html), which automatically deletes temporary (cached) files associated with each JarURLConnection when the Zip/Jar file opened in this mode is closed and the process exits. This is useful when downloading temporary jar files onto a local disk.
Miscellaneous Information
Added HTTP 1.1 client-side support and enhancements, such as http keepalives.
The SDK now does a better job of URL parsing by following RFC 2396 much more closely.