Ref: directoryManager.getLocalCacheFiles() already provides a list of .wool,...
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
|
||||
*/
|
||||
public List<File> getLocalCacheFiles() {
|
||||
|
||||
@@ -705,20 +705,13 @@ public class ServerRequest extends Thread {
|
||||
private String generateXMLForMD5cache() {
|
||||
List<FileMD5> md5s = new ArrayList<>();
|
||||
for (File local_file : this.directoryManager.getLocalCacheFiles()) {
|
||||
try {
|
||||
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());
|
||||
if (".wool".equals(extension)) {
|
||||
// node_file.setAttribute("md5", name);
|
||||
String name = local_file.getName().substring(0, local_file.getName().length() - extension.length());
|
||||
FileMD5 fileMD5 = new FileMD5();
|
||||
fileMD5.setMd5(name);
|
||||
|
||||
md5s.add(fileMD5);
|
||||
}
|
||||
}
|
||||
catch (StringIndexOutOfBoundsException e) { // because the file does not have an . its path
|
||||
}
|
||||
}
|
||||
|
||||
CacheFileMD5 cache = new CacheFileMD5();
|
||||
cache.setMd5s(md5s);
|
||||
|
||||
Reference in New Issue
Block a user