home *** CD-ROM | disk | FTP | other *** search
/ Java Programmer's Toolkit / Java Programmer's Toolkit.iso / solaris2 / jdk / src / java / net / content0.jav next >
Encoding:
Text File  |  1995-10-30  |  1.6 KB  |  41 lines

  1. /*
  2.  * @(#)ContentHandler.java    1.2 95/08/21
  3.  *
  4.  * Copyright (c) 1995 Sun Microsystems, Inc.  All Rights reserved
  5.  * Permission to use, copy, modify, and distribute this software
  6.  * and its documentation for NON-COMMERCIAL purposes and without
  7.  * fee is hereby granted provided that this copyright notice
  8.  * appears in all copies. Please refer to the file copyright.html
  9.  * for further important copyright and licensing information.
  10.  *
  11.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  12.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  13.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  14.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  15.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  16.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  17.  */
  18.  
  19. package java.net;
  20.  
  21. import java.io.IOException;
  22.  
  23. /**
  24.  * A class to read data from a URLConnection and construct an
  25.  * Object.  Specific subclasses of ContentHandler handle
  26.  * specific mime types.  It is the responsibility of a ContentHandlerFactor
  27.  * to select an appropriate ContentHandler for the mime-type
  28.  * of the URLConnection.  Applications should never call ContentHandlers
  29.  * directly, rather they should use URL.getContent() or
  30.  * URLConnection.getContent()
  31.  * @author  James Gosling
  32.  */
  33.  
  34. abstract public class ContentHandler {
  35.     /** Given an input stream positioned at the beginning of the
  36.     representation of an object, read that stream and recreate
  37.     the object from it */
  38.     abstract public Object getContent(URLConnection urlc) throws IOException;
  39. }
  40.  
  41.