Ref: configuration class shouldn't create and handle directory, DirectoryManager should do it

This commit is contained in:
Sheepit Renderfarm
2024-11-20 22:51:06 +00:00
parent 972092f2c1
commit 9cb1fe62cb
8 changed files with 233 additions and 218 deletions

View File

@@ -95,6 +95,7 @@ public class Server extends Thread {
private Configuration user_config;
private Client client;
private Log log;
private DirectoryManager directoryManager;
private long lastRequestTime;
private int keepmealive_duration; // time in ms
@@ -107,6 +108,7 @@ public class Server extends Thread {
this.user_config = user_config_;
this.client = client_;
this.log = Log.getInstance(this.user_config);
this.directoryManager = new DirectoryManager(this.user_config);
this.lastRequestTime = 0;
this.keepmealive_duration = 15 * 60 * 1000; // default 15min
@@ -690,7 +692,7 @@ public class Server extends Thread {
private String generateXMLForMD5cache() {
List<FileMD5> md5s = new ArrayList<>();
for (File local_file : this.user_config.getLocalCacheFiles()) {
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());