| | 19 | |
| | 20 | |
| | 21 | ------------------ |
| | 22 | Patch |
| | 23 | {{{ |
| | 24 | Index: src/org/openstreetmap/josm/data/Preferences.java |
| | 25 | =================================================================== |
| | 26 | --- src/org/openstreetmap/josm/data/Preferences.java (Revision 17404) |
| | 27 | +++ src/org/openstreetmap/josm/data/Preferences.java (Arbeitskopie) |
| | 28 | @@ -13,7 +13,9 @@ |
| | 29 | import java.io.Reader; |
| | 30 | import java.io.StringWriter; |
| | 31 | import java.nio.charset.StandardCharsets; |
| | 32 | +import java.nio.file.Files; |
| | 33 | import java.nio.file.InvalidPathException; |
| | 34 | +import java.nio.file.StandardCopyOption; |
| | 35 | import java.util.ArrayList; |
| | 36 | import java.util.Arrays; |
| | 37 | import java.util.Collection; |
| | 38 | @@ -447,7 +449,7 @@ |
| | 39 | } |
| | 40 | |
| | 41 | File tmpFile = new File(prefFile + "_tmp"); |
| | 42 | - Utils.copyFile(tmpFile, prefFile); |
| | 43 | + Files.move(tmpFile.toPath(), prefFile.toPath(), StandardCopyOption.REPLACE_EXISTING); |
| | 44 | Utils.deleteFile(tmpFile, marktr("Unable to delete temporary file {0}")); |
| | 45 | |
| | 46 | setCorrectPermissions(prefFile); |
| | 47 | }}} |