Skip to content
This repository was archived by the owner on Nov 6, 2018. It is now read-only.

Commit e54f76e

Browse files
committed
More Cleanup.
1 parent e289300 commit e54f76e

File tree

15 files changed

+18
-214
lines changed

15 files changed

+18
-214
lines changed

src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.AspNet.FileProviders
88
{
9-
public class EnumerableDirectoryContents : IDirectoryContents
9+
internal class EnumerableDirectoryContents : IDirectoryContents
1010
{
1111
private readonly IEnumerable<IFileInfo> _entries;
1212

src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Microsoft.AspNet.FileProviders
88
{
9-
public class NoopTrigger : IExpirationTrigger
9+
internal class NoopTrigger : IExpirationTrigger
1010
{
1111
public static NoopTrigger Singleton { get; } = new NoopTrigger();
1212

src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace Microsoft.AspNet.FileProviders
99
{
10-
public class NotFoundDirectoryContents : IDirectoryContents
10+
internal class NotFoundDirectoryContents : IDirectoryContents
1111
{
1212
public NotFoundDirectoryContents()
1313
{

src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Microsoft.AspNet.FileProviders
99
/// <summary>
1010
/// Represents a non-existing file.
1111
/// </summary>
12-
public class NotFoundFileInfo : IFileInfo
12+
internal class NotFoundFileInfo : IFileInfo
1313
{
1414
private readonly string _name;
1515

@@ -50,7 +50,7 @@ public string PhysicalPath
5050

5151
public Stream CreateReadStream()
5252
{
53-
throw new InvalidOperationException(string.Format("The file {0} does not exist.", Name));
53+
throw new FileNotFoundException(string.Format("The file {0} does not exist.", Name));
5454
}
5555
}
5656
}

src/Microsoft.AspNet.FileProviders.Common/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders.Embedded/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.0.0-*",
3-
"description": "Implementation of ASP.NET 5 embedded file provider abstractions.",
3+
"description": "Implementation of ASP.NET 5 file provider abstractions for embedded resources.",
44
"dependencies": {
55
"Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" },
66
"Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*"

src/Microsoft.AspNet.FileProviders.Physical/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": "1.0.0-*",
3-
"description": "Implementation of ASP.NET 5 physical file provider abstractions.",
3+
"description": "Implementation of ASP.NET 5 file provider abstractions for physical files.",
44
"dependencies": {
55
"Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" },
66
"Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*"

src/Microsoft.AspNet.FileProviders/Implementation/EnumerableDirectoryContents.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/Implementation/NotFoundDirectoryContents.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/Implementation/NotFoundFileInfo.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/Internal/NoopTrigger.cs

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/Microsoft.AspNet.FileProviders.xproj

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/Microsoft.AspNet.FileProviders/project.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

test/Microsoft.AspNet.FileProviders.Physical.Tests/PhysicalFileProviderTests.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,17 @@ public void Missing_Hidden_And_FilesStartingWithPeriod_ReturnFalse()
114114

115115
var provider = new PhysicalFileProvider(Path.GetTempPath());
116116

117-
provider.GetFileInfo(Guid.NewGuid().ToString()).Exists.ShouldBe(false);
118-
provider.GetFileInfo(hiddenFileName).Exists.ShouldBe(false);
119-
provider.GetFileInfo(fileNameStartingWithPeriod).Exists.ShouldBe(false);
117+
var file = provider.GetFileInfo(Guid.NewGuid().ToString());
118+
file.Exists.ShouldBe(false);
119+
Should.Throw<FileNotFoundException>(() => file.CreateReadStream());
120+
121+
file = provider.GetFileInfo(hiddenFileName);
122+
file.Exists.ShouldBe(false);
123+
Should.Throw<FileNotFoundException>(() => file.CreateReadStream());
124+
125+
file = provider.GetFileInfo(fileNameStartingWithPeriod);
126+
file.Exists.ShouldBe(false);
127+
Should.Throw<FileNotFoundException>(() => file.CreateReadStream());
120128
}
121129

122130
[Fact]
@@ -143,13 +151,6 @@ public void GetDirectoryContents_FromRootPath_ForEmptyDirectoryName()
143151
fileInfo.Exists.ShouldBe(true);
144152
}
145153

146-
[Fact]
147-
public void NotFoundFileInfo_BasicTests()
148-
{
149-
var info = new NotFoundFileInfo("NotFoundFile.txt");
150-
Should.Throw<InvalidOperationException>(() => info.CreateReadStream());
151-
}
152-
153154
[Fact]
154155
public void RelativePathPastRootNotAllowed()
155156
{

0 commit comments

Comments
 (0)