Shuffle old->save and new->old. @throws IOException a file operation error occurred
()
| 181 | * @throws IOException a file operation error occurred |
| 182 | */ |
| 183 | public void move() throws IOException { |
| 184 | if (configOld.renameTo(configSave)) { |
| 185 | if (!configNew.renameTo(configOld)) { |
| 186 | if (!configSave.renameTo(configOld)) { |
| 187 | throw new IOException(sm.getString("storeFileMover.restoreError", configNew.getAbsolutePath(), |
| 188 | configOld.getAbsolutePath())); |
| 189 | } |
| 190 | throw new IOException(sm.getString("storeFileMover.renameError", configNew.getAbsolutePath(), |
| 191 | configOld.getAbsolutePath())); |
| 192 | } |
| 193 | } else { |
| 194 | if (!configOld.exists()) { |
| 195 | if (!configNew.renameTo(configOld)) { |
| 196 | throw new IOException(sm.getString("storeFileMover.renameError", configNew.getAbsolutePath(), |
| 197 | configOld.getAbsolutePath())); |
| 198 | } |
| 199 | } else { |
| 200 | throw new IOException(sm.getString("storeFileMover.renameError", configOld.getAbsolutePath(), |
| 201 | configSave.getAbsolutePath())); |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Open an output writer for the new configuration file. |
no test coverage detected