From 3f65ec3318c2b5ded6e389897ae02abb128da52e Mon Sep 17 00:00:00 2001 From: Claus Date: Fri, 9 Sep 2016 13:36:34 +0200 Subject: [PATCH] fileservice getting and setting xslt file content. --- src/Umbraco.Core/Services/FileService.cs | 16 ++++++++++++++++ src/Umbraco.Core/Services/IFileService.cs | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/src/Umbraco.Core/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs index bdae4ce55d..aa722e0133 100644 --- a/src/Umbraco.Core/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -603,6 +603,22 @@ namespace Umbraco.Core.Services } } + public Stream GetXsltFileContentStream(string filepath) + { + using (var repository = RepositoryFactory.CreateXsltFileRepository(UowProvider.GetUnitOfWork())) + { + return repository.GetFileContentStream(filepath); + } + } + + public void SetXsltFileContent(string filepath, Stream content) + { + using (var repository = RepositoryFactory.CreateXsltFileRepository(UowProvider.GetUnitOfWork())) + { + repository.SetFileContent(filepath, content); + } + } + #region Partial Views public IEnumerable GetPartialViewSnippetNames(params string[] filterNames) diff --git a/src/Umbraco.Core/Services/IFileService.cs b/src/Umbraco.Core/Services/IFileService.cs index 3e1cbdd5ff..7d266ba64c 100644 --- a/src/Umbraco.Core/Services/IFileService.cs +++ b/src/Umbraco.Core/Services/IFileService.cs @@ -282,6 +282,20 @@ namespace Umbraco.Core.Services /// The content of the script file. void SetScriptFileContent(string filepath, Stream content); + /// + /// Gets the content of a XSLT file as a stream. + /// + /// The filesystem path to the XSLT file. + /// The content of the XSLT file. + Stream GetXsltFileContentStream(string filepath); + + /// + /// Sets the content of a XSLT file. + /// + /// The filesystem path to the XSLT file. + /// The content of the XSLT file. + void SetXsltFileContent(string filepath, Stream content); + /// /// Gets the content of a macro partial view as a stream. ///