Changeset 29946 in osm for applications/editors/josm/plugins/imagerycache
- Timestamp:
- 2013-09-23T19:29:35+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagerycache/src/org/openstreetmap/josm/plugins/imagerycache/TileDAOMapDB.java
r29944 r29946 69 69 storages.put(source, m); 70 70 71 System.out.println("Opened database file successfully: "+f.getAbsolutePath());71 Main.info("Opened database file successfully: "+f.getAbsolutePath()); 72 72 } catch (Exception ex) { 73 System.out.println("Error: can not create database, file: "+f.getAbsolutePath());73 Main.warn("Error: can not create database, file: "+f.getAbsolutePath()); 74 74 //System.out.println(ex.getMessage()); 75 75 ex.printStackTrace(); … … 171 171 172 172 // Merging! 173 System.out.println("Moving records from "+f.getName()+" to open storage "+source);173 Main.info("Moving records from "+f.getName()+" to open storage "+source); 174 174 myMap.putAll(m); 175 175 db.close(); … … 177 177 f.delete(); 178 178 179 System.out.println("Moved database successfully from file "+f.getAbsolutePath());179 Main.info("Moved database successfully from file "+f.getAbsolutePath()); 180 180 } catch (Exception ex) { 181 181 System.out.println(ex.getMessage()); … … 192 192 try { 193 193 dbs.get(name).close(); 194 dbs.remove(name); 195 storages.remove(name); 196 for (int t=0; t<20; t++) { 197 String fname = getDBFileName(name, t); 198 File f = new File(cacheFolder, fname); 199 if (!f.exists() || !f.canWrite()) continue; 194 } catch (Exception e) { 195 Main.warn("Something may be wrong, can not close the database."); 196 } 197 198 dbs.remove(name); 199 storages.remove(name); 200 for (int t=0; t<20; t++) { 201 String fname = getDBFileName(name, t); 202 File f = new File(cacheFolder, fname); 203 if (!f.exists() || !f.canWrite()) continue; 204 f.delete(); 205 f = new File(cacheFolder, fname+".p"); 206 if (!f.exists() || !f.canWrite()) continue; 207 f.delete(); 208 f = new File(cacheFolder, fname+".lock"); 209 if (!f.exists() || !f.canWrite()) continue; 210 try { 200 211 f.delete(); 201 f = new File(cacheFolder, fname+".p"); 202 if (!f.exists() || !f.canWrite()) continue; 203 f.delete(); 204 f = new File(cacheFolder, fname+".lock"); 205 if (!f.exists() || !f.canWrite()) continue; 206 f.delete(); 207 } 208 } catch (Exception e) { Main.warn("Can not delete file, maybe it is locvked by another JOSM instance. This is not a serious error then."); } 212 } catch (Exception e) { Main.warn("Can not delete file, maybe it is locvked by another JOSM instance. This is not a serious error then."); } 213 } 209 214 } 210 215 }
Note:
See TracChangeset
for help on using the changeset viewer.