/// <summary>
        /// Creates the default config file
        /// </summary>
        private void CreateDefaultConfiguration()
        {
            Configuration config = null;
            string _fileContent = string.Empty;
            try
            {
                using (StreamReader reader = new StreamReader(GetConfigurationPath()))
                {
                    _fileContent = reader.ReadToEnd();
                    reader.Close();
                }

                    if (string.IsNullOrEmpty(_fileContent))
                    {
                        config = new Configuration();
                        config.Username = string.Empty;
                        config.Password = string.Empty;
                        config.BaseUrl = @"https://my.powerfolder.com";
                        config.AddInID = "7be436757b194fb1b346250aabb3a97a";
                        config.TrackEmails = true;
                        config.FileLinkDialogEachEmail = true;
                        config.UseDefaultFileLinkConfig = false;
                        config.FileLinkDownloadCount = string.Empty;
                        config.FileLinkValidFor = string.Empty;
                        config.FileSizeConfiguration = "102400";
                    }
                    else
                    {
                        return;
                    }
                File.WriteAllText(GetConfigurationPath(), JsonConvert.SerializeObject(config));
                Log.LogThis("Successfuly installed the configuration.", eloglevel.info);
            }
            catch (IOException ie)
            {
                Log.LogThisError(ie);
                return;
            }
            catch (Exception e)
            {
                Log.LogThisError(e);
            }
        }
        /// <summary>
        /// Returns the current instance of the in memory configuration
        /// </summary>
        /// <returns></returns>
        private Configuration GetConfig()
        {
            if (_config != null) {
                return _config;
            }

            CreateDefaultConfiguration();

            using (StreamReader reader = new StreamReader(GetConfigurationPath()))
            {
                JsonSerializer serializer = new JsonSerializer();
                Configuration deSerializedConfig = JsonConvert.DeserializeObject<Configuration>(reader.ReadToEnd());
                _config = deSerializedConfig;
                reader.Close();
                return _config;
            }
        }
 /// <summary>
 /// Saves the in memory configuration to disk
 /// </summary>
 /// <param name="configuration"></param>
 public void SaveConfig()
 {
     if (_config == null)
     {
         _config = GetConfig();
     }
     try
     {
         File.WriteAllText(GetConfigurationPath(), JsonConvert.SerializeObject(_config));
         Log.LogThis("Configuration saved.", eloglevel.info);
     }
     catch (IOException ie)
     {
         Log.LogThisError(ie);
     }
     catch (Exception e)
     {
         Log.LogThisError(e);
     }
 }