fixed bug in GetFiles with filter param.

test for shadow filesystem GetFiles.
This commit is contained in:
Claus
2017-02-09 12:59:13 +01:00
parent 57945fcec6
commit 273a5cef28
2 changed files with 34 additions and 9 deletions

View File

@@ -200,10 +200,15 @@ namespace Umbraco.Core.IO
}
public IEnumerable<string> GetFiles(string path)
{
return GetFiles(path, null);
}
public IEnumerable<string> GetFiles(string path, string filter)
{
var normPath = NormPath(path);
var shadows = Nodes.Where(kvp => IsChild(normPath, kvp.Key)).ToArray();
var files = _fs.GetFiles(path);
var files = filter != null ? _fs.GetFiles(path, filter) : _fs.GetFiles(path);
return files
.Except(shadows.Where(kvp => (kvp.Value.IsFile && kvp.Value.IsDelete) || kvp.Value.IsDir)
.Select(kvp => kvp.Key))
@@ -211,11 +216,6 @@ namespace Umbraco.Core.IO
.Distinct();
}
public IEnumerable<string> GetFiles(string path, string filter)
{
return _fs.GetFiles(path, filter);
}
public Stream OpenFile(string path)
{
ShadowNode sf;