Merge branch 'ref/duplicate-code' into 'master'
Ref: directoryManager.getLocalCacheFiles() already provides a list of .wool,... See merge request sheepitrenderfarm/client!356
This commit is contained in:
@@ -176,7 +176,7 @@ public class DirectoryManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a list of archives (files with extensions .zip or .wool) in the
|
* @return a list of archives (files with extension .wool) in the
|
||||||
* working, storage, and shared downloads directories as long as they are not null
|
* working, storage, and shared downloads directories as long as they are not null
|
||||||
*/
|
*/
|
||||||
public List<File> getLocalCacheFiles() {
|
public List<File> getLocalCacheFiles() {
|
||||||
|
|||||||
@@ -705,20 +705,13 @@ public class ServerRequest extends Thread {
|
|||||||
private String generateXMLForMD5cache() {
|
private String generateXMLForMD5cache() {
|
||||||
List<FileMD5> md5s = new ArrayList<>();
|
List<FileMD5> md5s = new ArrayList<>();
|
||||||
for (File local_file : this.directoryManager.getLocalCacheFiles()) {
|
for (File local_file : this.directoryManager.getLocalCacheFiles()) {
|
||||||
try {
|
|
||||||
String extension = local_file.getName().substring(local_file.getName().lastIndexOf('.')).toLowerCase();
|
String extension = local_file.getName().substring(local_file.getName().lastIndexOf('.')).toLowerCase();
|
||||||
String name = local_file.getName().substring(0, local_file.getName().length() - 1 * extension.length());
|
String name = local_file.getName().substring(0, local_file.getName().length() - extension.length());
|
||||||
if (".wool".equals(extension)) {
|
|
||||||
// node_file.setAttribute("md5", name);
|
|
||||||
FileMD5 fileMD5 = new FileMD5();
|
FileMD5 fileMD5 = new FileMD5();
|
||||||
fileMD5.setMd5(name);
|
fileMD5.setMd5(name);
|
||||||
|
|
||||||
md5s.add(fileMD5);
|
md5s.add(fileMD5);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (StringIndexOutOfBoundsException e) { // because the file does not have an . its path
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CacheFileMD5 cache = new CacheFileMD5();
|
CacheFileMD5 cache = new CacheFileMD5();
|
||||||
cache.setMd5s(md5s);
|
cache.setMd5s(md5s);
|
||||||
|
|||||||
Reference in New Issue
Block a user