Provides classes for implementing network applications. (in alphabetical order)
1, Authenticator
- Abstract class
- Starting from 1.2 There are
- No parent classes and interfaces
The Authenticator class represents an object that knows how to obtain network connection validation. Typically, it does this by prompting the user to enter information. The application getPasswordAuthentication()
uses this class by overriding subclasses. This method typically uses various GetXXX () accessor methods to obtain information about the entity that requested validation. It must then obtain the user name and password by interacting with the user or some other non-interactive means. The credentials are then PasswordAuthentication
returned as return values. Next, the setDefault(Authenticator)
instance of this specific subclass is registered to the system by calling. When validation is required, the system calls one of the requestpasswordauthentication () methods, which in turn invoke the Getpasswordauthentication () method of the registered object. All methods that request validation have a default implementation that fails
2.
bindexception
3, CacheRequest
- Abstract class
- Starting from 1.5 There are
- No parent classes and interfaces
Represents a channel that stores resources in Responsecache. Instances of this kind provide an OutputStream object that the protocol handler can call to store the resource data in the cache, and an abort () method that allows for interrupt and discard cache storage operations. If you encounter IOException while reading a response from the cache or writing a response to the cache, the current cache store operation is aborted.
4.
Cacheresponse
5.
connectexception
6.
ContentHandler
- Abstract class
- Starting from 1.0 there are
- No parent
An abstract class ContentHandler
is URLConnection
a Object
superclass of all classes that are read from. Applications typically do not call methods directly in this class getContent
. Instead, URL
URLConnection
the method in the call or class getContent
. The application's content handler factory (an instance of the class that implements ContentHandlerFactory
the interface, which is invoked by the invocation setContentHandler
setting) is invoked by a String
String that gives the MIME type of the object that will be received on the socket. The factory returns ContentHandler
an instance of the subclass and calls its getContent
method to create the object.
7, ContentHandlerFactory
8, Cookiehandler
- Abstract class
- Starting from 1.5 There are
- No parent
The Cookiehandler object provides a callback mechanism to hook an HTTP status management policy implementation to an HTTP protocol handler. The HTTP State management mechanism uses HTTP requests and responses to specify how stateful sessions are created.
You can register the system-level cookiehandler to be used by the HTTP protocol handler by executing Cookiehandler.setdefault (Cookiehandler). Call Cookiehandler.getdefault () to get the currently registered Cookiehandler. For more information about HTTP state management, see RFC 2965:http State management mechanisms .
9, Cookiemanager
- Abstract class
- Starting from 1.6 There are
- Inherit Cookiehandler
Cookiemanager provides CookieHandler
a specific implementation that separates the store of cookies from the policy surrounding the acceptance and rejection of cookies. Initializes the Cookiemanager using an object that manages the store CookieStore
and makes a cookie accept/reject decision CookiePolicy
.
The HTTP cookie Management in the java.net package is as follows:
Usecookiehandler <-------httpurlconnection ^| impl| Usecookiemanager-------> cookiepolicy| use|--------> HttpCookie | ^| | use| Use | | --------> Cookiestore ^| impl
10, Cookiepolicy
- Interface
- Starting from 1.6 There are
- No parent
Cookiepolicy implementation determines which cookie should be accepted and which cookie should be rejected. Three predefined policy implementations are available, namely Accept_all, Accept_none, and Accept_original_server.
11.
Cookiestore
- Interface
- Starting from 1.6 There are
- No parent
A Cookiestore object that represents the cookie store. Cookies can be stored and obtained. CookieManager
call Cookiestore.add to save the cookie for each incoming HTTP response, and call Cookiestore.get to get the cookie for each outgoing HTTP request. Cookiestore is responsible for removing expired HttpCookie instances.
12, Datagrampacket
- Final class
- Starting from 1.0 there are
- No parent
This class represents a datagram package. Packet delivery service for non-connected packets. Each message is routed from one machine to another based only on the information contained in the package. Multiple packages sent from one machine to another may choose different routes, or they may arrive in a different order. No warranties are made for package delivery.
13.
Datagramsocket
- Class
- Starting from 1.0 there are
- No parent
This class represents the socket used to send and receive datagram packets.
A datagram socket is a send or receive point for a package delivery service. Each packet sent or received on a datagram socket is individually addressable and routed. Multiple packages sent from one machine to another may choose different routes, or they may arrive in a different order.
UDP broadcast forwarding is always enabled on Datagramsocket. In order to receive a broadcast packet, the Datagramsocket should be bound to a wildcard address. In some implementations, a broadcast packet can also be received when a datagramsocket is bound to a more specific address.
Example: DatagramSocket s = new DatagramSocket(null); s.bind(new InetSocketAddress(8888));
this is equivalent to: DatagramSocket s = new DatagramSocket(8888);
Two examples can create a datagramsocket that can receive broadcasts on UDP 8888 ports.
14, Datagramsocketimpl
- Abstract class
- Starting from 1.1 There are
- Implement Socketoptions
- Abstract base class for datagram and multicast sockets implementations.
15, Datagramsocketimplfactory
16, fileNameMap
17, HttpCookie
18, HttpURLConnection
- Abstract class
- Starting from 1.1 There are
- Inherit URLConnection
URLConnection that support HTTP-specific features. For more information, see the spec. Each httpurlconnection instance can be used to generate a single request, but other instances can transparently share the underlying network connected to the HTTP server. The call to the close () method on HttpURLConnection's InputStream or outputstream after the request frees the network resources associated with this instance, but has no effect on the shared persistent connection. If the persistent connection is idle when calling disconnect (), the underlying socket may be closed.
19. IDN
- Final class
- Starting from 1.6 There are
- No parent
Provides methods for internationalizing domain name (IDN) conversions between ordinary Unicode representations and ASCII compatibility Encoding (ACE) representations. Internationalized Domain names can use characters in the entire Unicode range, whereas traditional domain names are limited to ASCII characters. Aces are Unicode string encodings that use only ASCII characters and can be used with software that recognizes only traditional domain names, such as the domain name System.
20, Inet4address
- Final class
- Starting from 1.4 There are
- Inherit InetAddress
This class represents the Internet Protocol version 4 (IPV4) address. This class is made up of RFC 790:assigned Numbers,RFC 1918:address Allocation for Private internets , and RFC 2365:administ ratively Scoped IP multicast defined.
Text representation of an IP addressThe textual representation of the IPV4 address used as a method input takes one of the following forms:
When you specify four parts, each part is interpreted as a data byte and assigned from left to right to the four bytes of the IPV4 address.
When you specify a three-part address, the last part is interpreted as a 16-bit amount and placed at the rightmost two bytes of the network address. This makes the three-part address format convenient for specifying the Class B network address as 128.net.host.
When a two-part address is provided, the last part is interpreted as a 24-bit amount and placed at the rightmost three bytes of the network address. This makes the two-part address format easier to designate the Class A network address as Net.host.
When only one part is given, the value is stored directly in the network address, eliminating the need for byte rearrangement.
For methods that return text representations as output values, the first form is used, even if the four strings are separated by a dot.
21, Inet6address
22, InetAddress
23, Inetsocketaddress
Jdk_api Anatomy of the java.net pack