source: josm/trunk/src/org/openstreetmap/josm/io/MyHttpHandler.java@ 729

Last change on this file since 729 was 655, checked in by ramack, 16 years ago

patch by bruce89, closes #812; thanks bruce

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1/* Dummy handler just to load the override URLConnection class */
2package org.openstreetmap.josm.io;
3
4import java.io.IOException;
5import java.net.URL;
6import java.net.Proxy;
7
8// This is also a java.net.URLStreamHandler
9// Basically a copy of sun.net.www.protocol.http.Handler
10public class MyHttpHandler extends sun.net.www.protocol.http.Handler {
11 protected String proxy;
12 protected int proxyPort;
13
14 public MyHttpHandler() {
15 super();
16 proxy = null;
17 proxyPort = -1;
18 }
19
20 protected java.net.URLConnection openConnection(URL u)
21 throws IOException {
22 return openConnection(u, (Proxy) null);
23 }
24 public MyHttpHandler(String proxy, int port) {
25 this.proxy = proxy;
26 proxyPort = port;
27 }
28
29 protected java.net.URLConnection openConnection(URL u, Proxy p)
30 throws IOException {
31 return new MyHttpURLConnection(u, p, this);
32 }
33}
Note: See TracBrowser for help on using the repository browser.