Changeset 6248 in josm for trunk/src/org/openstreetmap/josm/io/CacheFiles.java
- Timestamp:
- 2013-09-23T16:47:50+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/CacheFiles.java
r6102 r6248 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.tools.Utils; 16 17 17 18 /** … … 115 116 new RandomAccessFile(data, "r").readFully(bytes); 116 117 return bytes; 117 } catch (Exception e) {118 System.out.println(e.getMessage());118 } catch (Exception e) { 119 Main.warn(e); 119 120 } 120 121 return null; … … 130 131 try { 131 132 File f = getPath(ident); 132 if (f.exists()) {133 if (f.exists()) { 133 134 f.delete(); 134 135 } 135 136 // rws also updates the file meta-data, i.e. last mod time 136 new RandomAccessFile(f, "rws").write(data); 137 } catch(Exception e){ 138 System.out.println(e.getMessage()); 137 RandomAccessFile raf = new RandomAccessFile(f, "rws"); 138 try { 139 raf.write(data); 140 } finally { 141 Utils.close(raf); 142 } 143 } catch (Exception e) { 144 Main.warn(e); 139 145 } 140 146 … … 164 170 } 165 171 return ImageIO.read(img); 166 } catch (Exception e) {167 System.out.println(e.getMessage());172 } catch (Exception e) { 173 Main.warn(e); 168 174 } 169 175 return null; … … 176 182 */ 177 183 public void saveImg(String ident, BufferedImage image) { 178 if (!enabled) return;184 if (!enabled) return; 179 185 try { 180 186 ImageIO.write(image, "png", getPath(ident, "png")); 181 } catch (Exception e){182 System.out.println(e.getMessage());187 } catch (Exception e) { 188 Main.warn(e); 183 189 } 184 190
Note:
See TracChangeset
for help on using the changeset viewer.