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

Last change on this file since 1814 was 1523, checked in by framm, 15 years ago
  • Major redesign of how JOSM talks to the OSM server. Connections now all go through a new OsmApi class that finds out which version the server uses. JOSM should now be able to handle 0.5 and 0.6 without configuration change. Config options osm-server.version and osm-server.additional-versions now obsolete. Handling of error and cancel situations might still need some improvement.
  • Property svn:eol-style set to native
File size: 908 bytes
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.