Using StorageProvider.Combine() in Recipe

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-04-08 15:31:27 -07:00
parent 7353fe5f58
commit c89477eaa2

View File

@@ -10,7 +10,7 @@ using Orchard.Recipes.Models;
namespace Orchard.Recipes.Services {
public class RecipeJournalManager : IRecipeJournal {
private readonly IStorageProvider _storageProvider;
private readonly string _recipeJournalFolder = "RecipeJournal" + Path.DirectorySeparatorChar;
private const string RecipeJournalFolder = "RecipeJournal";
private const string WebConfig =
@"
<configuration>
@@ -92,10 +92,10 @@ namespace Orchard.Recipes.Services {
private IStorageFile GetJournalFile(string executionId) {
IStorageFile journalFile;
var journalPath = Path.Combine(_recipeJournalFolder, executionId);
var journalPath = _storageProvider.Combine(RecipeJournalFolder, executionId);
try {
if (_storageProvider.TryCreateFolder(_recipeJournalFolder)) {
var webConfigPath = Path.Combine(_recipeJournalFolder, "web.config");
if (_storageProvider.TryCreateFolder(RecipeJournalFolder)) {
var webConfigPath = _storageProvider.Combine(RecipeJournalFolder, "web.config");
var webConfigFile = _storageProvider.CreateFile(webConfigPath);
WriteWebConfig(webConfigFile);
}