Merge branch 'ref/lib-path' into 'master'

Ref: do not re-invent the wheel, use existing lib

See merge request sheepitrenderfarm/client!360
This commit is contained in:
Sheepit Renderfarm
2025-01-11 18:12:53 +00:00

View File

@@ -150,9 +150,9 @@ public class DirectoryManager {
}
else {
try {
String extension = file.getName().substring(file.getName().lastIndexOf('.')).toLowerCase();
String name = file.getName().substring(0, file.getName().length() - 1 * extension.length());
if (".wool".equals(extension)) {
String extension = FilenameUtils.getExtension(file.getName()).toLowerCase();
String name = FilenameUtils.removeExtension(file.getName());
if ("wool".equals(extension)) {
// check if the md5 of the file is ok
String md5_local = Utils.md5(file.getAbsolutePath());
@@ -166,7 +166,7 @@ public class DirectoryManager {
file.delete();
}
}
catch (StringIndexOutOfBoundsException e) { // because the file does not have an . in his path
catch (IllegalArgumentException e) { // because the file does not have an . in his path
file.delete();
}
}