We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5c90fd commit 0c0f4bcCopy full SHA for 0c0f4bc
1 file changed
src/main/java/org/comroid/api/io/FileFlag.java
@@ -1,11 +1,18 @@
1
package org.comroid.api.io;
2
3
+import lombok.SneakyThrows;
4
+
5
import java.io.File;
6
7
public final class FileFlag {
8
+ @SneakyThrows
9
+ public static boolean enable(File file) {
10
+ if (!file.isAbsolute()) return enable(file.getAbsoluteFile());
11
+ return file.exists() || file.createNewFile();
12
+ }
13
14
public static boolean consume(File file) {
- if (!file.isAbsolute())
- return consume(file.getAbsoluteFile());
15
+ if (!file.isAbsolute()) return consume(file.getAbsoluteFile());
16
return file.exists() && file.delete();
17
}
18
0 commit comments