diff --git a/FileSystem.sln b/FileSystem.sln index 388bc61a..c15e291a 100644 --- a/FileSystem.sln +++ b/FileSystem.sln @@ -1,16 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.22710.0 +VisualStudioVersion = 14.0.22803.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A1477614-E825-4204-A684-385004B63AEB}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders", "src\Microsoft.AspNet.FileProviders\Microsoft.AspNet.FileProviders.xproj", "{A830B046-595A-4992-B9E1-3C28C6440707}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{E399495E-82B8-4C06-8779-C1D02BEF4495}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Tests", "test\Microsoft.AspNet.FileProviders.Tests\Microsoft.AspNet.FileProviders.Tests.xproj", "{66FE5FDF-BBF9-4573-A7B7-53551731C0F9}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1A060559-74DD-4B5A-BBA1-E8A441E729C1}" ProjectSection(SolutionItems) = preProject global.json = global.json @@ -22,6 +18,16 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Framework.FileSys EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Framework.FileSystemGlobbing.Tests", "test\Microsoft.Framework.FileSystemGlobbing.Tests\Microsoft.Framework.FileSystemGlobbing.Tests.xproj", "{45A5A942-4EFB-4839-AEA3-EB1D2BAB332C}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Embedded", "src\Microsoft.AspNet.FileProviders.Embedded\Microsoft.AspNet.FileProviders.Embedded.xproj", "{BD98C115-7FA6-4A78-8198-9650A4706B79}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Physical", "src\Microsoft.AspNet.FileProviders.Physical\Microsoft.AspNet.FileProviders.Physical.xproj", "{BA56E837-C793-4A7D-824D-84492028E066}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Embedded.Tests", "test\Microsoft.AspNet.FileProviders.Embedded.Tests\Microsoft.AspNet.FileProviders.Embedded.Tests.xproj", "{6B6BA57A-B32D-430A-AF39-09CAA85308C2}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Physical.Tests", "test\Microsoft.AspNet.FileProviders.Physical.Tests\Microsoft.AspNet.FileProviders.Physical.Tests.xproj", "{66FE5FDF-BBF9-4573-A7B7-53551731C0F9}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FileProviders.Common", "src\Microsoft.AspNet.FileProviders.Common\Microsoft.AspNet.FileProviders.Common.xproj", "{92C2C85C-D1A5-44BD-BE23-238E08471B4D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -32,26 +38,6 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A830B046-595A-4992-B9E1-3C28C6440707}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Debug|x86.ActiveCfg = Debug|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Release|Any CPU.Build.0 = Release|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A830B046-595A-4992-B9E1-3C28C6440707}.Release|x86.ActiveCfg = Release|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|x86.ActiveCfg = Debug|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Any CPU.Build.0 = Release|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|x86.ActiveCfg = Release|Any CPU {DD94B7E8-3A59-4F84-98A0-8139BE259A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DD94B7E8-3A59-4F84-98A0-8139BE259A87}.Debug|Any CPU.Build.0 = Debug|Any CPU {DD94B7E8-3A59-4F84-98A0-8139BE259A87}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -86,15 +72,78 @@ Global {45A5A942-4EFB-4839-AEA3-EB1D2BAB332C}.Release|Mixed Platforms.Build.0 = Release|Any CPU {45A5A942-4EFB-4839-AEA3-EB1D2BAB332C}.Release|x86.ActiveCfg = Release|Any CPU {45A5A942-4EFB-4839-AEA3-EB1D2BAB332C}.Release|x86.Build.0 = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Debug|x86.Build.0 = Debug|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|Any CPU.Build.0 = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|x86.ActiveCfg = Release|Any CPU + {BD98C115-7FA6-4A78-8198-9650A4706B79}.Release|x86.Build.0 = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Debug|x86.Build.0 = Debug|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|Any CPU.Build.0 = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|x86.ActiveCfg = Release|Any CPU + {BA56E837-C793-4A7D-824D-84492028E066}.Release|x86.Build.0 = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|x86.ActiveCfg = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Debug|x86.Build.0 = Debug|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|Any CPU.Build.0 = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|x86.ActiveCfg = Release|Any CPU + {6B6BA57A-B32D-430A-AF39-09CAA85308C2}.Release|x86.Build.0 = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|x86.ActiveCfg = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Debug|x86.Build.0 = Debug|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Any CPU.Build.0 = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|x86.ActiveCfg = Release|Any CPU + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9}.Release|x86.Build.0 = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|x86.ActiveCfg = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Debug|x86.Build.0 = Debug|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|Any CPU.Build.0 = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|x86.ActiveCfg = Release|Any CPU + {92C2C85C-D1A5-44BD-BE23-238E08471B4D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {A830B046-595A-4992-B9E1-3C28C6440707} = {A1477614-E825-4204-A684-385004B63AEB} - {66FE5FDF-BBF9-4573-A7B7-53551731C0F9} = {E399495E-82B8-4C06-8779-C1D02BEF4495} {DD94B7E8-3A59-4F84-98A0-8139BE259A87} = {A1477614-E825-4204-A684-385004B63AEB} {970449A2-3BBB-4E87-8513-C41F109B1A3E} = {A1477614-E825-4204-A684-385004B63AEB} {45A5A942-4EFB-4839-AEA3-EB1D2BAB332C} = {E399495E-82B8-4C06-8779-C1D02BEF4495} + {BD98C115-7FA6-4A78-8198-9650A4706B79} = {A1477614-E825-4204-A684-385004B63AEB} + {BA56E837-C793-4A7D-824D-84492028E066} = {A1477614-E825-4204-A684-385004B63AEB} + {6B6BA57A-B32D-430A-AF39-09CAA85308C2} = {E399495E-82B8-4C06-8779-C1D02BEF4495} + {66FE5FDF-BBF9-4573-A7B7-53551731C0F9} = {E399495E-82B8-4C06-8779-C1D02BEF4495} + {92C2C85C-D1A5-44BD-BE23-238E08471B4D} = {A1477614-E825-4204-A684-385004B63AEB} EndGlobalSection EndGlobal diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/EnumerableDirectoryContents.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs similarity index 92% rename from src/Microsoft.AspNet.FileProviders/Implementation/EnumerableDirectoryContents.cs rename to src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs index 34b2fcaf..a69a8002 100644 --- a/src/Microsoft.AspNet.FileProviders/Implementation/EnumerableDirectoryContents.cs +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs @@ -6,7 +6,7 @@ namespace Microsoft.AspNet.FileProviders { - public class EnumerableDirectoryContents : IDirectoryContents + internal class EnumerableDirectoryContents : IDirectoryContents { private readonly IEnumerable _entries; diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/NoopTrigger.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/Implementation/NoopTrigger.cs rename to src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/NotFoundDirectoryContents.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs similarity index 91% rename from src/Microsoft.AspNet.FileProviders/Implementation/NotFoundDirectoryContents.cs rename to src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs index 3ee62bf8..1245f2ef 100644 --- a/src/Microsoft.AspNet.FileProviders/Implementation/NotFoundDirectoryContents.cs +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs @@ -7,7 +7,7 @@ namespace Microsoft.AspNet.FileProviders { - public class NotFoundDirectoryContents : IDirectoryContents + internal class NotFoundDirectoryContents : IDirectoryContents { public NotFoundDirectoryContents() { diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/NotFoundFileInfo.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs similarity index 87% rename from src/Microsoft.AspNet.FileProviders/Implementation/NotFoundFileInfo.cs rename to src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs index 2ea5fc59..6f474d38 100644 --- a/src/Microsoft.AspNet.FileProviders/Implementation/NotFoundFileInfo.cs +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.FileProviders /// /// Represents a non-existing file. /// - public class NotFoundFileInfo : IFileInfo + internal class NotFoundFileInfo : IFileInfo { private readonly string _name; @@ -50,7 +50,7 @@ public string PhysicalPath public Stream CreateReadStream() { - throw new InvalidOperationException(string.Format("The file {0} does not exist.", Name)); + throw new FileNotFoundException(string.Format("The file {0} does not exist.", Name)); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/Microsoft.AspNet.FileProviders.xproj b/src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj similarity index 60% rename from src/Microsoft.AspNet.FileProviders/Microsoft.AspNet.FileProviders.xproj rename to src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj index bf48bc26..de91540f 100644 --- a/src/Microsoft.AspNet.FileProviders/Microsoft.AspNet.FileProviders.xproj +++ b/src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj @@ -1,14 +1,17 @@  - + 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - a830b046-595a-4992-b9e1-3c28c6440707 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + 92c2c85c-d1a5-44bd-be23-238e08471b4d + + + + + 2.0 diff --git a/src/Microsoft.AspNet.FileProviders.Common/project.json b/src/Microsoft.AspNet.FileProviders.Common/project.json new file mode 100644 index 00000000..d6e4772c --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/project.json @@ -0,0 +1,16 @@ +{ + "version": "1.0.0-*", + "shared": "**/*.cs", + "dependencies": { + "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*" + }, + "frameworks": { + "net45": { }, + "dnx451": { }, + "dnxcore50": { + "dependencies": { + "System.Linq": "4.0.0-beta-*" + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/EmbeddedFileProvider.cs b/src/Microsoft.AspNet.FileProviders.Embedded/EmbeddedFileProvider.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/EmbeddedFileProvider.cs rename to src/Microsoft.AspNet.FileProviders.Embedded/EmbeddedFileProvider.cs diff --git a/src/Microsoft.AspNet.FileProviders.Embedded/Microsoft.AspNet.FileProviders.Embedded.xproj b/src/Microsoft.AspNet.FileProviders.Embedded/Microsoft.AspNet.FileProviders.Embedded.xproj new file mode 100644 index 00000000..910535ff --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Embedded/Microsoft.AspNet.FileProviders.Embedded.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + bd98c115-7fa6-4a78-8198-9650a4706b79 + + + + + + + + 2.0 + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.FileProviders.Embedded/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/Properties/AssemblyInfo.cs rename to src/Microsoft.AspNet.FileProviders.Embedded/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.FileProviders.Embedded/project.json b/src/Microsoft.AspNet.FileProviders.Embedded/project.json new file mode 100644 index 00000000..fc6db239 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Embedded/project.json @@ -0,0 +1,18 @@ +{ + "version": "1.0.0-*", + "description": "Implementation of ASP.NET 5 file provider abstractions for embedded resources.", + "dependencies": { + "Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" }, + "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*" + }, + "frameworks": { + "net45": { }, + "dnx451": { }, + "dnxcore50": { + "dependencies": { + "System.Reflection": "4.0.10-*", + "System.Runtime.Extensions": "4.0.10-beta-*" + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/FileChangeTrigger.cs b/src/Microsoft.AspNet.FileProviders.Physical/FileChangeTrigger.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/Implementation/FileChangeTrigger.cs rename to src/Microsoft.AspNet.FileProviders.Physical/FileChangeTrigger.cs diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/FileSystemInfoHelper.cs b/src/Microsoft.AspNet.FileProviders.Physical/FileSystemInfoHelper.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/Implementation/FileSystemInfoHelper.cs rename to src/Microsoft.AspNet.FileProviders.Physical/FileSystemInfoHelper.cs diff --git a/src/Microsoft.AspNet.FileProviders.Physical/Microsoft.AspNet.FileProviders.Physical.xproj b/src/Microsoft.AspNet.FileProviders.Physical/Microsoft.AspNet.FileProviders.Physical.xproj new file mode 100644 index 00000000..96b415a9 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Physical/Microsoft.AspNet.FileProviders.Physical.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + ba56e837-c793-4a7d-824d-84492028e066 + + + + + + + + 2.0 + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/PhysicalFileProvider.cs b/src/Microsoft.AspNet.FileProviders.Physical/PhysicalFileProvider.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/PhysicalFileProvider.cs rename to src/Microsoft.AspNet.FileProviders.Physical/PhysicalFileProvider.cs diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/PhysicalFilesWatcher.cs b/src/Microsoft.AspNet.FileProviders.Physical/PhysicalFilesWatcher.cs similarity index 100% rename from src/Microsoft.AspNet.FileProviders/Implementation/PhysicalFilesWatcher.cs rename to src/Microsoft.AspNet.FileProviders.Physical/PhysicalFilesWatcher.cs diff --git a/src/Microsoft.AspNet.FileProviders.Physical/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.FileProviders.Physical/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f5c6f4a8 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Physical/Properties/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// 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.Reflection; + +[assembly: AssemblyMetadata("Serviceable", "True")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/project.json b/src/Microsoft.AspNet.FileProviders.Physical/project.json similarity index 84% rename from src/Microsoft.AspNet.FileProviders/project.json rename to src/Microsoft.AspNet.FileProviders.Physical/project.json index 8f190b11..bdb01efd 100644 --- a/src/Microsoft.AspNet.FileProviders/project.json +++ b/src/Microsoft.AspNet.FileProviders.Physical/project.json @@ -1,7 +1,8 @@ { "version": "1.0.0-*", - "description": "Implementation of ASP.NET 5 file provider abstractions.", + "description": "Implementation of ASP.NET 5 file provider abstractions for physical files.", "dependencies": { + "Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" }, "Microsoft.AspNet.FileProviders.Interfaces": "1.0.0-*" }, "frameworks": { @@ -12,12 +13,10 @@ "System.Collections.Concurrent": "4.0.10-beta-*", "System.IO.FileSystem.Watcher": "4.0.0-beta-*", "System.IO.FileSystem": "4.0.0-beta-*", - "System.Linq": "4.0.0-beta-*", - "System.Reflection": "4.0.10-*", "System.Runtime.Extensions": "4.0.10-beta-*", "System.Text.RegularExpressions": "4.0.10-beta-*", "System.Threading": "4.0.10-beta-*" } } } -} +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.FileProviders.Tests/EmbeddedFileProviderTests.cs b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/EmbeddedFileProviderTests.cs similarity index 98% rename from test/Microsoft.AspNet.FileProviders.Tests/EmbeddedFileProviderTests.cs rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/EmbeddedFileProviderTests.cs index 83b49281..bc5b052b 100644 --- a/test/Microsoft.AspNet.FileProviders.Tests/EmbeddedFileProviderTests.cs +++ b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/EmbeddedFileProviderTests.cs @@ -7,7 +7,7 @@ using Shouldly; using Xunit; -namespace Microsoft.AspNet.FileProviders.Tests +namespace Microsoft.AspNet.FileProviders.Embedded.Tests { public class EmbeddedFileProviderTests { diff --git a/test/Microsoft.AspNet.FileProviders.Tests/File.txt b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/File.txt similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/File.txt rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/File.txt diff --git a/test/Microsoft.AspNet.FileProviders.Embedded.Tests/Microsoft.AspNet.FileProviders.Embedded.Tests.xproj b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/Microsoft.AspNet.FileProviders.Embedded.Tests.xproj new file mode 100644 index 00000000..26e2c1ad --- /dev/null +++ b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/Microsoft.AspNet.FileProviders.Embedded.Tests.xproj @@ -0,0 +1,22 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 6b6ba57a-b32d-430a-af39-09caa85308c2 + + + + + + + 2.0 + + + + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.FileProviders.Tests/Resources/File.txt b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/Resources/File.txt similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/Resources/File.txt rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/Resources/File.txt diff --git a/test/Microsoft.AspNet.FileProviders.Tests/Resources/ResourcesInSubdirectory/File3.txt b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/Resources/ResourcesInSubdirectory/File3.txt similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/Resources/ResourcesInSubdirectory/File3.txt rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/Resources/ResourcesInSubdirectory/File3.txt diff --git a/test/Microsoft.AspNet.FileProviders.Embedded.Tests/project.json b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/project.json new file mode 100644 index 00000000..52826748 --- /dev/null +++ b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/project.json @@ -0,0 +1,15 @@ +{ + "dependencies": { + "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", + "Shouldly": "1.1.1.1", + "xunit.runner.aspnet": "2.0.0-aspnet-*" + }, + "commands": { + "test": "xunit.runner.aspnet" + }, + "resource": "File.txt;sub/**;Resources/**", + "frameworks": { + "dnx451": { } + } +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.FileProviders.Tests/sub/File2.txt b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/sub/File2.txt similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/sub/File2.txt rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/sub/File2.txt diff --git a/test/Microsoft.AspNet.FileProviders.Tests/sub/dir/File3.txt b/test/Microsoft.AspNet.FileProviders.Embedded.Tests/sub/dir/File3.txt similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/sub/dir/File3.txt rename to test/Microsoft.AspNet.FileProviders.Embedded.Tests/sub/dir/File3.txt diff --git a/test/Microsoft.AspNet.FileProviders.Physical.Tests/File.txt b/test/Microsoft.AspNet.FileProviders.Physical.Tests/File.txt new file mode 100644 index 00000000..b27f91d6 --- /dev/null +++ b/test/Microsoft.AspNet.FileProviders.Physical.Tests/File.txt @@ -0,0 +1 @@ +Hello diff --git a/test/Microsoft.AspNet.FileProviders.Tests/Microsoft.AspNet.FileProviders.Tests.xproj b/test/Microsoft.AspNet.FileProviders.Physical.Tests/Microsoft.AspNet.FileProviders.Physical.Tests.xproj similarity index 100% rename from test/Microsoft.AspNet.FileProviders.Tests/Microsoft.AspNet.FileProviders.Tests.xproj rename to test/Microsoft.AspNet.FileProviders.Physical.Tests/Microsoft.AspNet.FileProviders.Physical.Tests.xproj diff --git a/test/Microsoft.AspNet.FileProviders.Tests/PhysicalFileProviderTests.cs b/test/Microsoft.AspNet.FileProviders.Physical.Tests/PhysicalFileProviderTests.cs similarity index 98% rename from test/Microsoft.AspNet.FileProviders.Tests/PhysicalFileProviderTests.cs rename to test/Microsoft.AspNet.FileProviders.Physical.Tests/PhysicalFileProviderTests.cs index 379d491e..a67e7013 100644 --- a/test/Microsoft.AspNet.FileProviders.Tests/PhysicalFileProviderTests.cs +++ b/test/Microsoft.AspNet.FileProviders.Physical.Tests/PhysicalFileProviderTests.cs @@ -114,9 +114,17 @@ public void Missing_Hidden_And_FilesStartingWithPeriod_ReturnFalse() var provider = new PhysicalFileProvider(Path.GetTempPath()); - provider.GetFileInfo(Guid.NewGuid().ToString()).Exists.ShouldBe(false); - provider.GetFileInfo(hiddenFileName).Exists.ShouldBe(false); - provider.GetFileInfo(fileNameStartingWithPeriod).Exists.ShouldBe(false); + var file = provider.GetFileInfo(Guid.NewGuid().ToString()); + file.Exists.ShouldBe(false); + Should.Throw(() => file.CreateReadStream()); + + file = provider.GetFileInfo(hiddenFileName); + file.Exists.ShouldBe(false); + Should.Throw(() => file.CreateReadStream()); + + file = provider.GetFileInfo(fileNameStartingWithPeriod); + file.Exists.ShouldBe(false); + Should.Throw(() => file.CreateReadStream()); } [Fact] @@ -143,13 +151,6 @@ public void GetDirectoryContents_FromRootPath_ForEmptyDirectoryName() fileInfo.Exists.ShouldBe(true); } - [Fact] - public void NotFoundFileInfo_BasicTests() - { - var info = new NotFoundFileInfo("NotFoundFile.txt"); - Should.Throw(() => info.CreateReadStream()); - } - [Fact] public void RelativePathPastRootNotAllowed() { diff --git a/test/Microsoft.AspNet.FileProviders.Tests/project.json b/test/Microsoft.AspNet.FileProviders.Physical.Tests/project.json similarity index 72% rename from test/Microsoft.AspNet.FileProviders.Tests/project.json rename to test/Microsoft.AspNet.FileProviders.Physical.Tests/project.json index 4053a973..49952c30 100644 --- a/test/Microsoft.AspNet.FileProviders.Tests/project.json +++ b/test/Microsoft.AspNet.FileProviders.Physical.Tests/project.json @@ -1,6 +1,6 @@ { "dependencies": { - "Microsoft.AspNet.FileProviders": "1.0.0-*", + "Microsoft.AspNet.FileProviders.Physical": "1.0.0-*", "Microsoft.AspNet.Testing": "1.0.0-*", "Shouldly": "1.1.1.1", "xunit.runner.aspnet": "2.0.0-aspnet-*" @@ -8,7 +8,6 @@ "commands": { "test": "xunit.runner.aspnet" }, - "resources": "File.txt;sub/**;Resources/**", "frameworks": { "dnx451": { } } diff --git a/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/File2.txt b/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/File2.txt new file mode 100644 index 00000000..e8ecfad8 --- /dev/null +++ b/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/File2.txt @@ -0,0 +1 @@ +Hello2 diff --git a/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/dir/File3.txt b/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/dir/File3.txt new file mode 100644 index 00000000..49cc8ef0 Binary files /dev/null and b/test/Microsoft.AspNet.FileProviders.Physical.Tests/sub/dir/File3.txt differ