public void Init()
{
lock (this.WriteLock)
{
if (this.Initialized)
return;
this.Initialized = true;
if (!File.Exists(this.PutioFile.DataProvider.LocalIndexFile))
{
if (!Directory.Exists(this.PutioFile.DataProvider.LocalStorageDirectory))
Directory.CreateDirectory(this.PutioFile.DataProvider.LocalStorageDirectory);
File.Create(this.PutioFile.DataProvider.LocalIndexFile).Close();
}
using (StreamReader sr = new StreamReader(this.PutioFile.DataProvider.LocalIndexFile))
{
while (sr.Peek() >= 0)
{
String[] range_str = sr.ReadLine().Split(',');
this.RangeCollection.AddRange(Int64.Parse(range_str[0]), Int64.Parse(range_str[1]));
}
}
}
}