Skip to content

Commit 6197bd0

Browse files
Delete system.properties in a better way apache#14080
1 parent d637770 commit 6197bd0

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/file/SystemPropertiesHandler.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,16 +199,13 @@ public void resetFilePath(String filePath) {
199199
}
200200

201201
public void delete() {
202-
try {
203-
FileUtils.deleteFile(this.formalFile);
204-
} catch (IOException e) {
205-
LOGGER.warn("Delete formalFile error, ", e);
206-
}
207-
208-
try {
209-
FileUtils.deleteFile(this.tmpFile);
210-
} catch (IOException e) {
211-
LOGGER.warn("Delete tmpFile error, ", e);
202+
this.formalFile.delete();
203+
this.tmpFile.delete();
204+
if (this.formalFile.exists() || this.tmpFile.exists()) {
205+
LOGGER.warn(
206+
"Failed to delete system.properties file, you should manually delete them: {}, {}",
207+
this.formalFile.getAbsoluteFile(),
208+
this.tmpFile.getAbsolutePath());
212209
}
213210
}
214211
}

0 commit comments

Comments
 (0)