jixuan1989 commented on a change in pull request #31: Fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/31#discussion_r250988069
##########
File path:
iotdb/src/test/java/org/apache/iotdb/db/postback/sender/FileManagerTest.java
##########
@@ -55,20 +56,19 @@ public void setUp() throws Exception {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() throws IOException, InterruptedException {
Thread.sleep(1000);
- delete(new File(POST_BACK_DIRECTORY_TEST));
- new File(POST_BACK_DIRECTORY_TEST).delete();
+ Files.deleteIfExists((java.nio.file.Path) new
Path(POST_BACK_DIRECTORY_TEST));
}
- public void delete(File file) {
+ public void delete(File file) throws IOException {
if (file.isFile() || file.list().length == 0) {
- file.delete();
+ Files.deleteIfExists((java.nio.file.Path) new
Path(file.getAbsolutePath()));
Review comment:
why not using import java.nio.file.Path..
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services