controller: add temporary block to migrate keys to none space containing file names

This commit is contained in:
Hylke Bons 2013-01-05 14:03:47 +01:00
parent 3381e5a517
commit 66730f9f7f

View file

@ -196,6 +196,15 @@ namespace SparkleShare {
foreach (string file_name in Directory.GetFiles (keys_path)) {
if (file_name.EndsWith (".key")) {
key_file_path = Path.Combine (keys_path, file_name);
// Replace spaces with underscores in old keys
if (file_name.Contains (" ")) {
string new_file_name = file_name.Replace (" ", "_");
File.Move (key_file_path, Path.Combine (keys_path));
File.Move (key_file_path + ".pub", Path.Combine (keys_path, new_file_name + ".pub"));
key_file_path = Path.Combine (keys_path, new_file_name);
}
SparkleKeys.ImportPrivateKey (key_file_path);
break;