diff --git a/src/main/java/com/sheepit/client/Configuration.java b/src/main/java/com/sheepit/client/Configuration.java index b07f849..1230de9 100644 --- a/src/main/java/com/sheepit/client/Configuration.java +++ b/src/main/java/com/sheepit/client/Configuration.java @@ -219,38 +219,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(); } /**