Changeset 4810 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2012-01-17T14:09:10+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
r4709 r4810 78 78 this.ident = ident; 79 79 this.updateInterval = updateInterval; 80 this.path = new File(Main.pref.get PreferencesDir(), ident);80 this.path = new File(Main.pref.getCacheDirectory(), ident); 81 81 } 82 82 … … 86 86 */ 87 87 public byte[] updateIfRequired() throws T { 88 if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/100088 if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/1000 89 89 || !isCacheValid()) 90 90 return updateForce(); … … 97 97 */ 98 98 public String updateIfRequiredString() throws T { 99 if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/100099 if (Main.pref.getInteger("cache." + ident, 0) + updateInterval < new Date().getTime()/1000 100 100 || !isCacheValid()) 101 101 return updateForceString(); … … 121 121 updateForce(); 122 122 try { 123 return new String(data, "utf-8");124 } catch (UnsupportedEncodingException e){123 return new String(data, "utf-8"); 124 } catch (UnsupportedEncodingException e){ 125 125 e.printStackTrace(); 126 126 return ""; … … 133 133 */ 134 134 public byte[] getData() throws T { 135 if (data == null) {135 if (data == null) { 136 136 loadFromDisk(); 137 137 } … … 156 156 */ 157 157 private void loadFromDisk() throws T { 158 if (Main.applet)158 if (Main.applet) 159 159 this.data = updateForce(); 160 160 else { … … 164 164 input.read(this.data); 165 165 input.close(); 166 } catch (IOException e) {166 } catch (IOException e) { 167 167 this.data = updateForce(); 168 168 } … … 174 174 */ 175 175 private void saveToDisk() { 176 if (Main.applet)176 if (Main.applet) 177 177 return; 178 178 try {
Note:
See TracChangeset
for help on using the changeset viewer.