mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Removed buggy redundant check in FileUtils.deleteIfExists()
The documentation for File.delete() says that the method return true if the the file is successfully deleted, otherwise false is returned. An exception is thrown only when the file is not accessible (for permission problem). Removing the extra check solves another problem, for example in a folder with the following situation: linkToFileA -> FileA FileA if we remove FileA, we remain with a broken link that can't be removed using FileUtils.deleteIfExists() because calling File.exists() on a broken link returns *false*. This commit solve this problem.
This commit is contained in:
parent
d57681c442
commit
956ddda98e
@ -274,10 +274,6 @@ public class FileUtils {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!file.exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return file.delete();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user