MCPcopy Index your code
hub / github.com/apache/tomcat / move

Method move

java/org/apache/catalina/storeconfig/StoreFileMover.java:183–204  ·  view source on GitHub ↗

Shuffle old->save and new->old. @throws IOException a file operation error occurred

()

Source from the content-addressed store, hash-verified

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.

Callers 6

storeMethod · 0.95
storeWithBackupMethod · 0.95
executeMethod · 0.80
migrateLegacyAppMethod · 0.80
messageReceivedMethod · 0.80
saveMethod · 0.80

Calls 3

getStringMethod · 0.65
existsMethod · 0.65
getAbsolutePathMethod · 0.45

Tested by

no test coverage detected