Networking Enhancements in Java SE 8 (original) (raw)
A new class
[java.net.URLPermission](../../../api/java/net/URLPermission.html)
has been added.URLPermission
represents a permission for accessing a resource (or set of resources) defined by a given URL, and for a given set of user-settable request methods and request headers.The
jdk.net
package has been added that contains platform specific socket options and a mechanism for setting these options on all of the standard socket types. The socket options are defined injdk.net.ExtendedSocketOptions
and the first one to be defined isSO_FLOW_SLA
, which is an option for establishing socket flows for multitennant applications. The classjdk.net.Sockets
provides the mechanism for setting and getting these extended options.In class
[HttpURLConnection](../../../api/java/net/HttpURLConnection.html)
, if a security manager is installed, and if a method is called which results in an attempt to open a connection, the caller must possess either:- a "connect"
[SocketPermission](../../../api/java/net/SocketPermission.html)
to the host/port combination of the destination URL or - a
[URLPermission](../../../api/java/net/URLPermission.html)
that permits this request.
- a "connect"
If automatic redirection is enabled, and this request is redirected to another destination, then the caller must also have permission to connect to the redirected host/URL.