public static List<Session> GetSessionsFromPath(string dataPath, TimePeriod period)
{
var res = new List<Session>();
if (Directory.Exists(dataPath))
{
foreach (var filePath in Directory.GetFiles(dataPath, "*.*.txt", SearchOption.AllDirectories))
{
if (filePath.EndsWith(WebLogger.FileName, StringComparison.OrdinalIgnoreCase))
continue;
var session = ReadSession(filePath, period);
if (session != null)
res.Add(session);
}
res.Sort((x, y) => x.CreationTime.CompareTo(y.CreationTime));
}
return res;
}