Skip to content

Commit

Permalink
Update variable name (openmessaging#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsunghanjacktsai authored Oct 10, 2022
1 parent f00c488 commit 6765275
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,23 +366,23 @@ public static void atomicMvFile(File srcFile, File destFile) throws IOException
Files.move(srcPath, destPath, StandardCopyOption.ATOMIC_MOVE);
} catch (IOException mvFailed) {
if (mvFailed instanceof AtomicMoveNotSupportedException) {
logger.warn("Unable to support atomic move, back to non-atomic move, error: {}", mvFailed.getMessage());
LOGGER.warn("Unable to support atomic move, back to non-atomic move, error: {}", mvFailed.getMessage());
} else {
logger.warn("Unable to move files atomically, back to non-atomic move, error: {}", mvFailed.getMessage());
LOGGER.warn("Unable to move files atomically, back to non-atomic move, error: {}", mvFailed.getMessage());
}
if (destFile.exists()) {
logger.info("The file has already existed in the destination location {}", destPath);
LOGGER.info("The file has already existed in the destination location {}", destPath);
}
try {
Files.move(srcPath, destPath, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException replaceFailed) {
replaceFailed.addSuppressed(mvFailed);
logger.warn("Unable to move {} to {}. Try deleting {}", srcPath, destPath, srcPath);
LOGGER.warn("Unable to move {} to {}. Try deleting {}", srcPath, destPath, srcPath);
try {
Files.deleteIfExists(srcPath);
} catch (IOException deleteFailed) {
deleteFailed.addSuppressed(replaceFailed);
logger.warn("Unable to delete {}", srcPath);
LOGGER.warn("Unable to delete {}", srcPath);
throw deleteFailed;
}
throw replaceFailed;
Expand All @@ -396,7 +396,7 @@ public static void fsync(File file) throws IOException {
boolean isDir = file.isDirectory();
// Unable to force sync on Windows
if (isDir && System.getProperty("os.name").toLowerCase().contains("win")) {
logger.warn("Unable to force sync directory {} on Windows", file);
LOGGER.warn("Unable to force sync directory {} on Windows", file);
return;
}
try (final FileChannel fc = FileChannel.open(file.toPath(), isDir ? StandardOpenOption.READ
Expand Down

0 comments on commit 6765275

Please sign in to comment.