Changeset 19964 in osm for applications/editors/josm
- Timestamp:
- 2010-02-10T17:17:25+01:00 (15 years ago)
- Location:
- applications/editors/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/DatabaseParser.java
r15582 r19964 96 96 URL url = new URL(getDatabaseUrl()); 97 97 HttpURLConnection con = (HttpURLConnection)url.openConnection(); 98 99 //Set timeout for 10 seconds. 100 con.setReadTimeout(10000); 98 101 con.connect(); 99 102 103 System.err.println("CzechAddress: Stahuji: " + url.toString()); 100 104 System.err.println("CzechAddress: Server vrátil: " + con.getResponseMessage()); 101 105 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/MvcrParser.java
r18894 r19964 208 208 //============================================================================== 209 209 210 static final String URL_DEFAULT = "http:// web.mvcr.cz/adresa/adresy.zip";210 static final String URL_DEFAULT = "http://aplikace.mvcr.cz/adresa/adresy.zip"; 211 211 static final String URL_PREFERENCES_KEY = "czechaddress.databaseurl"; 212 212 213 static final String[] OLD_URLS = { 214 "http://web.mvcr.cz/adresa/adresy.zip" // Remove around 10.02.2011 215 }; 216 213 217 @Override 214 218 protected String getDatabaseUrl() { 215 219 216 if (!Main.pref.hasKey(URL_PREFERENCES_KEY)) 217 Main.pref.put(URL_PREFERENCES_KEY, URL_DEFAULT); 218 219 return Main.pref.get(URL_PREFERENCES_KEY); 220 // No longer add the default URL into preferences. 221 //if (!Main.pref.hasKey(URL_PREFERENCES_KEY)) 222 // Main.pref.put(URL_PREFERENCES_KEY, URL_DEFAULT); 223 224 /* If an outdated URL is found in the preferences, replace it by the 225 * new one. However the urls from the list should be removed after 226 * a reasonable amount of time (one year?), because this is a 227 * non-systematic solution. 228 */ 229 for (String oldUrl : OLD_URLS) 230 if (Main.pref.get(URL_PREFERENCES_KEY, URL_DEFAULT).equals(oldUrl)) { 231 Main.pref.put(URL_PREFERENCES_KEY, URL_DEFAULT); 232 break; 233 } 234 235 return Main.pref.get(URL_PREFERENCES_KEY, URL_DEFAULT); 220 236 } 221 237
Note:
See TracChangeset
for help on using the changeset viewer.