Skip to content

Commit

Permalink
Delete system.properties in a better way #14080
Browse files Browse the repository at this point in the history
  • Loading branch information
liyuheng55555 authored Nov 13, 2024
1 parent d637770 commit 6197bd0
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,13 @@ public void resetFilePath(String filePath) {
}

public void delete() {
try {
FileUtils.deleteFile(this.formalFile);
} catch (IOException e) {
LOGGER.warn("Delete formalFile error, ", e);
}

try {
FileUtils.deleteFile(this.tmpFile);
} catch (IOException e) {
LOGGER.warn("Delete tmpFile error, ", e);
this.formalFile.delete();
this.tmpFile.delete();
if (this.formalFile.exists() || this.tmpFile.exists()) {
LOGGER.warn(
"Failed to delete system.properties file, you should manually delete them: {}, {}",
this.formalFile.getAbsoluteFile(),
this.tmpFile.getAbsolutePath());
}
}
}

0 comments on commit 6197bd0

Please sign in to comment.