This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 6197bd0e32a Delete system.properties in a better way #14080
6197bd0e32a is described below
commit 6197bd0e32a21ae210c198a84b605e0badc70f43
Author: Li Yu Heng <[email protected]>
AuthorDate: Wed Nov 13 21:01:11 2024 +0800
Delete system.properties in a better way #14080
---
.../iotdb/commons/file/SystemPropertiesHandler.java | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/file/SystemPropertiesHandler.java
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/file/SystemPropertiesHandler.java
index 076353275e6..5264f4735f6 100644
---
a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/file/SystemPropertiesHandler.java
+++
b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/file/SystemPropertiesHandler.java
@@ -199,16 +199,13 @@ public abstract class SystemPropertiesHandler {
}
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());
}
}
}