Skip to content

Commit

Permalink
Reacting to FIleSystemGlobbing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaybhargavb committed Feb 20, 2015
1 parent d9e2581 commit 6b3119e
Showing 1 changed file with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.AspNet.FileProviders;
using Microsoft.Framework.FileSystemGlobbing.Abstractions;

Expand Down Expand Up @@ -76,32 +74,8 @@ public override DirectoryInfoBase ParentDirectory
}
}

public override IEnumerable<FileSystemInfoBase> EnumerateFileSystemInfos(
string searchPattern,
SearchOption searchOption)
public override IEnumerable<FileSystemInfoBase> EnumerateFileSystemInfos()
{
if (!string.Equals(searchPattern, "*", StringComparison.OrdinalIgnoreCase))
{
// Only * based searches are ever performed against this API and we have an item to change this API
// such that the searchPattern doesn't even get passed in, so this is just a safe-guard until then.
// The searchPattern here has no relation to the globbing pattern.
throw new ArgumentException(
"Only full wildcard searches are supported, i.e. \"*\".",
nameof(searchPattern));
}

if (searchOption != SearchOption.TopDirectoryOnly)
{
// Only SearchOption.TopDirectoryOnly is actually used in the implementation of Matcher and will likely
// be removed from DirectoryInfoBase in the near future. This is just a safe-guard until then.
// The searchOption here has no relation to the globbing pattern.
throw new ArgumentException(
$"Only {nameof(SearchOption.TopDirectoryOnly)} is supported.",
nameof(searchOption));
}



foreach (var fileInfo in _fileProvider.GetDirectoryContents(RelativePath))
{
yield return BuildFileResult(fileInfo);
Expand Down

0 comments on commit 6b3119e

Please sign in to comment.