Package java.net |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
public abstract class java.net.ContentHandler extends java.lang.Object { // Constructors public ContentHandler(); // Methods public abstract Object getContent(URLConnection urlc); }
The abstract class ContentHandler is the superclass of all classes that read an Object from a URLConnection .
An application does not generally call the getContentHandler method in this class directly. Instead, an application calls the getContent method in class URL or in URL----Connection . The application's content handler factory (an instance of a class that implements the interface ContentHandlerFactory set up by a call to set-Content-Handler ) is called with a String giving the MIME type of the object being received on the socket. The factory returns an instance of a subclass of ContentHandler, and its getContent method is called to create the object.
public ContentHandler()The default constructor for class ContentHandler.
public abstract Object getContent(URLConnection urlc)throws IOExceptionGiven an URL connect stream positioned at the beginning of the representation of an object, this method reads that stream and creates an object from it.
Return Value:
Returns The object read by the ContentHandler.
Parameter Description urlc a URL connection Throw:
If an IO error occurs while reading the object.