Changeset 4812 in josm
- Timestamp:
- 2012-01-17T15:21:50+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r4806 r4812 200 200 for (String source : sources.split(";")) { 201 201 try { 202 MirroredInputStream s = new MirroredInputStream(source , OsmValidator.getValidatorDir(), -1);202 MirroredInputStream s = new MirroredInputStream(source); 203 203 InputStreamReader r; 204 204 try { -
trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
r4638 r4812 24 24 25 25 import org.openstreetmap.josm.Main; 26 import org.openstreetmap.josm.tools.Utils; 26 27 27 28 /** … … 69 70 } 70 71 } else { 71 if(Main.applet) { 72 if (Main.applet) { 72 73 URLConnection conn = url.openConnection(); 73 74 conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000); … … 80 81 } 81 82 } catch (java.net.MalformedURLException e) { 82 if(name.startsWith("resource://")) { 83 if (name.startsWith("resource://")) { 83 84 fs = getClass().getResourceAsStream( 84 85 name.substring("resource:/".length())); … … 161 162 } 162 163 } 163 Main.pref.put(prefKey, null); 164 Main.pref.putCollection(prefKey, null); 164 165 } 165 166 } catch (java.net.MalformedURLException e) {} … … 174 175 StringBuilder prefKey = new StringBuilder("mirror."); 175 176 if (destDir != null) { 176 String prefDir = Main.pref.getPreferencesDir();177 if (destDir.startsWith(prefDir)) {178 destDir = destDir.substring(prefDir.length());179 }180 177 prefKey.append(destDir); 181 178 prefKey.append("."); … … 198 195 || maxTime <= 0 // arbitrary value <= 0 is deprecated 199 196 ) { 200 maxTime = Main.pref.getInteger("mirror.maxtime", 7*24*60*60); 197 maxTime = Main.pref.getInteger("mirror.maxtime", 7*24*60*60); // one week 201 198 } 202 199 age = System.currentTimeMillis() - Long.parseLong(localPathEntry.get(0)); … … 206 203 } 207 204 } 208 if(destDir == null) { 209 destDir = Main.pref.get PreferencesDir();205 if (destDir == null) { 206 destDir = Main.pref.getCacheDirectory().getPath(); 210 207 } 211 208 … … 252 249 } 253 250 } finally { 254 if (bis != null) { 255 try { 256 bis.close(); 257 } catch (IOException e) { 258 e.printStackTrace(); 259 } 260 } 261 if (bos != null) { 262 try { 263 bos.close(); 264 } catch (IOException e) { 265 e.printStackTrace(); 266 } 267 } 251 Utils.close(bis); 252 Utils.close(bos); 268 253 } 269 254
Note:
See TracChangeset
for help on using the changeset viewer.