Merge branch 'ref/path-lib' into 'master'
Ref: do not re-invent the wheel, use existing lib See merge request sheepitrenderfarm/client!357
This commit is contained in:
@@ -23,6 +23,7 @@ import com.sheepit.client.logger.Log;
|
||||
import com.sheepit.client.datamodel.server.Chunk;
|
||||
import com.sheepit.client.utils.Utils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -203,9 +204,9 @@ public class DirectoryManager {
|
||||
for (File file : files) {
|
||||
if (file.isFile()) {
|
||||
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());
|
||||
|
||||
@@ -214,10 +215,11 @@ public class DirectoryManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e) { // because the file does not have an . his path
|
||||
catch (IllegalArgumentException e) { // because the file does not have an . his path
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files_local;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user