Added more Methods
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>dev.unlegitdqrk</groupId>
|
||||
<artifactId>unlegitlibrary</artifactId>
|
||||
<version>1.7.6</version>
|
||||
<version>1.7.7</version>
|
||||
<url>https://unlegitdqrk.dev/</url>
|
||||
<description>Just a big library</description>
|
||||
|
||||
|
||||
@@ -124,7 +124,12 @@ public final class FileUtils extends DefaultMethodsOverrider {
|
||||
return new String(content, StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
private static List<File> listFiles(File dir, String... exts) {
|
||||
public static String stripExt(String name) {
|
||||
int idx = name.lastIndexOf('.');
|
||||
return idx == -1 ? name : name.substring(0, idx);
|
||||
}
|
||||
|
||||
public static List<File> listFiles(File dir, String... exts) {
|
||||
if (!dir.exists()) return List.of();
|
||||
File[] files = dir.listFiles((d, name) -> {
|
||||
for (String ext : exts) {
|
||||
|
||||
Reference in New Issue
Block a user