Changeset 4128 in josm for trunk/src/org
- Timestamp:
- 2011-06-08T09:06:48+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
r4022 r4128 183 183 private File checkLocal(URL url, String destDir, long maxTime) throws IOException { 184 184 String prefKey = getPrefKey(url, destDir); 185 long age = 0L; 185 186 File file = null; 186 187 // FIXME: replace with normal getCollection after july 2011 … … 195 196 maxTime = Main.pref.getInteger("mirror.maxtime", 7*24*60*60); 196 197 } 197 if (System.currentTimeMillis() - Long.parseLong(lp[0]) < maxTime*1000) { 198 age = System.currentTimeMillis() - Long.parseLong(lp[0]); 199 if (age < maxTime*1000) { 198 200 return file; 199 201 } … … 231 233 Main.pref.putCollection(prefKey, Arrays.asList(new String[] 232 234 {Long.toString(System.currentTimeMillis()), file.toString()})); 235 } catch (IOException e) { 236 if (age > maxTime*1000 && age < maxTime*1000*2) { 237 System.out.println(tr("Failed to load {0}, use cached file and retry next time: {1}", 238 url, e)); 239 return file; 240 } else { 241 throw e; 242 } 233 243 } finally { 234 244 if (bis != null) {
Note:
See TracChangeset
for help on using the changeset viewer.