Merge branch 'Conf-misc-fixes' into 'master'

Rework getdir functions

See merge request sheepitrenderfarm/client!262
This commit is contained in:
harlekin
2023-11-22 17:10:16 +00:00

View File

@@ -212,38 +212,20 @@ import lombok.Data;
}
}
public void setStorageDir(File dir) {
if (dir != null) {
if (dir.exists() == false) {
dir.mkdir();
}
this.storageDirectory = dir;
}
}
/**
* @return the storage directory or the working directory if the former is not defined
*/
public File getStorageDir() {
if (this.storageDirectory == null) {
return this.workingDirectory;
}
else {
return this.storageDirectory;
}
return this.storageDirectory == null ? this.workingDirectory : this.storageDirectory;
}
/**
* @return the user specified cache directory or null if it hasn't been specified
*/
public File getCacheDirForSettings() {
if (this.userHasSpecifiedACacheDir == false) {
return null;
}
else {
// when the user have a cache directory a "sheepit" and "sheepit_binary_cache" is be automaticaly added
return this.workingDirectory.getParentFile();
}
// when the user has a cache directory specified,
// a "sheepit" and "sheepit_binary_cache" directory is to be automatically created
return this.userHasSpecifiedACacheDir == false ? null : this.workingDirectory.getParentFile();
}
/**