the DEFAULT only tries to save in current dir. Cleaned up code for that

This commit is contained in:
nathan 2015-02-02 13:14:07 +01:00
parent b6d21259f7
commit bdb633b06c

View File

@ -10,8 +10,8 @@ import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters; import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import dorkbox.network.util.store.SettingsStore; import dorkbox.network.util.store.SettingsStore;
import dorkbox.util.FileUtil;
import dorkbox.util.bytes.ByteArrayWrapper; import dorkbox.util.bytes.ByteArrayWrapper;
import dorkbox.util.properties.PropertiesProvider;
import dorkbox.util.storage.Storage; import dorkbox.util.storage.Storage;
/** /**
@ -81,14 +81,10 @@ class PropertyStore extends SettingsStore {
// Method of preference for creating/getting this connection store. Private since only the ConnectionStoreProxy calls this // Method of preference for creating/getting this connection store. Private since only the ConnectionStoreProxy calls this
public PropertyStore(String name) { public PropertyStore(String name) {
this.name = name; this.name = name;
File propertiesFile;
if (PropertiesProvider.basePath.isEmpty()) { // DEFAULT location! (if it's for testing, etc)
propertiesFile = new File(SETTINGS_FILE_NAME); File propertiesFile = new File(SETTINGS_FILE_NAME);
} else { propertiesFile = FileUtil.normalize(propertiesFile);
// sometimes we want to change the base path location
propertiesFile = new File(PropertiesProvider.basePath, SETTINGS_FILE_NAME);
}
propertiesFile = propertiesFile.getAbsoluteFile(); propertiesFile = propertiesFile.getAbsoluteFile();