Create dedicated directories on the user set cache dir (who is supose to be already dedicated...)
This commit is contained in:
@@ -213,8 +213,10 @@ public class Configuration {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.userHasSpecifiedACacheDir = true;
|
this.userHasSpecifiedACacheDir = true;
|
||||||
this.workingDirectory = cache_dir_;
|
this.workingDirectory = new File(cache_dir_.getAbsolutePath() + File.separator + "sheepit");
|
||||||
this.storageDirectory = cache_dir_;
|
this.storageDirectory = new File(cache_dir_.getAbsolutePath() + File.separator + "sheepit_binary_cache");
|
||||||
|
this.workingDirectory.mkdir();
|
||||||
|
this.storageDirectory.mkdir();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -241,6 +243,16 @@ public class Configuration {
|
|||||||
return this.userHasSpecifiedACacheDir;
|
return this.userHasSpecifiedACacheDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File getCacheDirForSettings() {
|
||||||
|
if (this.getUserHasSpecifiedACacheDir() == 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setExtras(String str) {
|
public void setExtras(String str) {
|
||||||
this.extras = str;
|
this.extras = str;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class Settings implements Activity {
|
|||||||
directory_panel.add(cacheLabel);
|
directory_panel.add(cacheLabel);
|
||||||
String destination = DUMMY_CACHE_DIR;
|
String destination = DUMMY_CACHE_DIR;
|
||||||
if (config.getUserHasSpecifiedACacheDir()) {
|
if (config.getUserHasSpecifiedACacheDir()) {
|
||||||
destination = config.getStorageDir().getName();
|
destination = config.getCacheDirForSettings().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
JPanel cacheDirWrapper = new JPanel();
|
JPanel cacheDirWrapper = new JPanel();
|
||||||
@@ -607,8 +607,8 @@ public class Settings implements Activity {
|
|||||||
parent.setCredentials(login.getText(), new String(password.getPassword()));
|
parent.setCredentials(login.getText(), new String(password.getPassword()));
|
||||||
|
|
||||||
String cachePath = null;
|
String cachePath = null;
|
||||||
if (config.getUserHasSpecifiedACacheDir() && config.getStorageDir() != null) {
|
if (config.getUserHasSpecifiedACacheDir() && config.getCacheDirForSettings() != null) {
|
||||||
cachePath = config.getStorageDir().getAbsolutePath();
|
cachePath = config.getCacheDirForSettings().getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
String hostnameText = hostname.getText();
|
String hostnameText = hostname.getText();
|
||||||
|
|||||||
Reference in New Issue
Block a user