private string ReadBody(DirectoryPath root, string path, string uri)
{
if (!string.IsNullOrWhiteSpace(path))
{
var file = _fileSystem.GetFile(root.CombineWithFilePath(path));
if (file.Exists)
{
using (var stream = file.OpenRead())
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}
else if (!string.IsNullOrWhiteSpace(uri))
{
return new System.Net.WebClient().DownloadString(uri);
}
return null;
}