Handler.java
Upload User: demmber
Upload Date: 2007-12-22
Package Size: 717k
Code Size: 2k
Category:

Java Develop

Development Platform:

Java

  1. /*
  2.  * @(#)Handler.java 0.3-3 18/06/1999
  3.  *
  4.  *  This file is part of the HTTPClient.http package 
  5.  *  Copyright (C) 1996-1999  Ronald Tschal鋜
  6.  *
  7.  *  This library is free software; you can redistribute it and/or
  8.  *  modify it under the terms of the GNU Lesser General Public
  9.  *  License as published by the Free Software Foundation; either
  10.  *  version 2 of the License, or (at your option) any later version.
  11.  *
  12.  *  This library is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  *  Lesser General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU Lesser General Public
  18.  *  License along with this library; if not, write to the Free
  19.  *  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20.  *  MA 02111-1307, USA
  21.  *
  22.  *  For questions, suggestions, bug-reports, enhancement-requests etc.
  23.  *  I may be contacted at:
  24.  *
  25.  *  ronald@innovation.ch
  26.  *
  27.  */
  28. package HTTPClient.http;
  29. import java.net.URL;
  30. import java.net.URLConnection;
  31. import java.net.URLStreamHandler;
  32. import java.io.IOException;
  33. import HTTPClient.ProtocolNotSuppException;
  34. /**
  35.  * This class implements a URLStreamHandler for http URLs. With this you
  36.  * can use the HTTPClient package as a replacement for the JDK's client.
  37.  * To do so define the property java.protocol.handler.pkgs=HTTPClient .
  38.  *
  39.  * @version 0.3-3  18/06/1999
  40.  * @author Ronald Tschal鋜
  41.  */
  42. public class Handler extends URLStreamHandler
  43. {
  44.     public Handler()  throws ProtocolNotSuppException
  45.     {
  46. new HTTPClient.HTTPConnection("http", "", -1);
  47.     }
  48.     public URLConnection openConnection(URL url)
  49.     throws IOException, ProtocolNotSuppException
  50.     {
  51.         return new HTTPClient.HttpURLConnection(url);
  52.     }
  53. }