Changeset 6248 in josm for trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
- Timestamp:
- 2013-09-23T16:47:50+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
r6104 r6248 89 89 90 90 if (!autosaveDir.exists() && !autosaveDir.mkdirs()) { 91 System.out.println(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath()));91 Main.warn(tr("Unable to create directory {0}, autosave will be disabled", autosaveDir.getAbsolutePath())); 92 92 return; 93 93 } 94 94 if (!deletedLayersDir.exists() && !deletedLayersDir.mkdirs()) { 95 System.out.println(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath()));95 Main.warn(tr("Unable to create directory {0}, autosave will be disabled", deletedLayersDir.getAbsolutePath())); 96 96 return; 97 97 } … … 159 159 Utils.close(ps); 160 160 } catch (Throwable t) { 161 System.err.println(t.getMessage());161 Main.error(t); 162 162 } 163 163 return result; 164 164 } else { 165 System.out.println(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath()));165 Main.warn(tr("Unable to create file {0}, other filename will be used", result.getAbsolutePath())); 166 166 if (index > PROP_INDEX_LIMIT.get()) 167 167 throw new IOException("index limit exceeded"); 168 168 } 169 169 } catch (IOException e) { 170 System.err.println(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage()));170 Main.error(tr("IOError while creating file, autosave will be skipped: {0}", e.getMessage())); 171 171 return null; 172 172 } … … 190 190 File oldFile = info.backupFiles.remove(); 191 191 if (!oldFile.delete()) { 192 System.out.println(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath()));192 Main.warn(tr("Unable to delete old backup file {0}", oldFile.getAbsolutePath())); 193 193 } else { 194 194 getPidFile(oldFile).delete(); … … 207 207 } catch (Throwable t) { 208 208 // Don't let exception stop time thread 209 System.err.println("Autosave failed: "); 209 Main.error("Autosave failed:"); 210 Main.error(t); 210 211 t.printStackTrace(); 211 212 } … … 257 258 } 258 259 } catch (IOException e) { 259 System.err.println(tr("Error while creating backup of removed layer: {0}", e.getMessage()));260 Main.error(tr("Error while creating backup of removed layer: {0}", e.getMessage())); 260 261 } 261 262 … … 300 301 } 301 302 } catch (Throwable t) { 302 System.err.println(t.getClass()+":"+t.getMessage());303 Main.error(t); 303 304 } finally { 304 305 Utils.close(reader); 305 306 } 306 307 } catch (Throwable t) { 307 System.err.println(t.getClass()+":"+t.getMessage());308 Main.error(t); 308 309 } 309 310 } … … 359 360 deletedLayers.remove(backupFile); 360 361 if (!backupFile.delete()) { 361 System.err.println(String.format("Warning:Could not delete old backup file %s", backupFile));362 Main.warn(String.format("Could not delete old backup file %s", backupFile)); 362 363 } 363 364 } … … 366 367 pidFile.delete(); 367 368 } else { 368 System.err.println(String.format("Warning:Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName()));369 Main.warn(String.format("Could not move autosaved file %s to %s folder", f.getName(), deletedLayersDir.getName())); 369 370 // we cannot move to deleted folder, so just try to delete it directly 370 371 if (!f.delete()) { 371 System.err.println(String.format("Warning:Could not delete backup file %s", f));372 Main.warn(String.format("Could not delete backup file %s", f)); 372 373 } else { 373 374 pidFile.delete(); … … 380 381 } 381 382 if (!next.delete()) { 382 System.err.println(String.format("Warning:Could not delete archived backup file %s", next));383 Main.warn(String.format("Could not delete archived backup file %s", next)); 383 384 } 384 385 }
Note:
See TracChangeset
for help on using the changeset viewer.
