We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
FileUtility#deleteFile(...)
boolean
1 parent def34f4 commit 8d23817Copy full SHA for 8d23817
src/main/java/xyz/srnyx/javautilities/FileUtility.java
@@ -21,12 +21,16 @@ public class FileUtility {
21
*
22
* @param path the path to the file
23
* @param silentFail if true, the error will be printed if the task fails
24
+ *
25
+ * @return true if the file was deleted, false otherwise
26
*/
- public static void deleteFile(@NotNull Path path, boolean silentFail) {
27
+ public static boolean deleteFile(@NotNull Path path, boolean silentFail) {
28
try {
29
Files.delete(path);
30
+ return true;
31
} catch (final IOException e) {
32
if (!silentFail) e.printStackTrace();
33
+ return false;
34
}
35
36
0 commit comments