Handlebars Extension (#286)

* wip

* HandlebarsRegistrationCallback

* HandlebarsContextFactoryTests

* 1.0.21.0

* fix sonar

* LocalFileSystemHandler

* readme

* Fix System.IO.IOException
This commit is contained in:
Stef Heyenrath
2019-07-03 18:37:22 +02:00
committed by GitHub
parent 653e03fcd9
commit 93682c9bbf
37 changed files with 366 additions and 208 deletions

View File

@@ -11,6 +11,24 @@ namespace WireMock.Handlers
{
private static readonly string AdminMappingsFolder = Path.Combine("__admin", "mappings");
private readonly string _rootFolder;
/// <summary>
/// Initializes a new instance of the <see cref="LocalFileSystemHandler"/> class.
/// </summary>
public LocalFileSystemHandler() : this(Directory.GetCurrentDirectory())
{
}
/// <summary>
/// Initializes a new instance of the <see cref="LocalFileSystemHandler"/> class.
/// </summary>
/// <param name="rootFolder">The root folder.</param>
public LocalFileSystemHandler(string rootFolder)
{
_rootFolder = rootFolder;
}
/// <inheritdoc cref="IFileSystemHandler.FolderExists"/>
public bool FolderExists(string path)
{
@@ -38,7 +56,7 @@ namespace WireMock.Handlers
/// <inheritdoc cref="IFileSystemHandler.GetMappingFolder"/>
public string GetMappingFolder()
{
return Path.Combine(Directory.GetCurrentDirectory(), AdminMappingsFolder);
return Path.Combine(_rootFolder, AdminMappingsFolder);
}
/// <inheritdoc cref="IFileSystemHandler.ReadMappingFile"/>