home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / ContentHandler.java < prev    next >
Text File  |  1996-05-03  |  2KB  |  44 lines

  1. /*
  2.  * @(#)ContentHandler.java    1.4 95/12/18
  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 ContentHandlerFactory
  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.     /** 
  36.      * Given an input stream positioned at the beginning of the
  37.      * representation of an object, reads that stream and recreates
  38.      * the object from it. 
  39.      * @exception IOException  An IO error occurred while reading the object.
  40.      */
  41.     abstract public Object getContent(URLConnection urlc) throws IOException;
  42. }
  43.  
  44.