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.Common/Implementation/EnumerableDirectoryContents.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs new file mode 100644 index 00000000..34b2fcaf --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/EnumerableDirectoryContents.cs @@ -0,0 +1,33 @@ +// 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.Collections; +using System.Collections.Generic; + +namespace Microsoft.AspNet.FileProviders +{ + public class EnumerableDirectoryContents : IDirectoryContents + { + private readonly IEnumerable _entries; + + public EnumerableDirectoryContents(IEnumerable entries) + { + _entries = entries; + } + + public bool Exists + { + get { return true; } + } + + public IEnumerator GetEnumerator() + { + return _entries.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return _entries.GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/Implementation/NoopTrigger.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs similarity index 94% rename from src/Microsoft.AspNet.FileProviders/Implementation/NoopTrigger.cs rename to src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs index 7ad3f5ad..94a8ae3e 100644 --- a/src/Microsoft.AspNet.FileProviders/Implementation/NoopTrigger.cs +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NoopTrigger.cs @@ -6,7 +6,7 @@ namespace Microsoft.AspNet.FileProviders { - internal class NoopTrigger : IExpirationTrigger + public class NoopTrigger : IExpirationTrigger { public static NoopTrigger Singleton { get; } = new NoopTrigger(); diff --git a/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs new file mode 100644 index 00000000..3ee62bf8 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundDirectoryContents.cs @@ -0,0 +1,31 @@ +// 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.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.AspNet.FileProviders +{ + public class NotFoundDirectoryContents : IDirectoryContents + { + public NotFoundDirectoryContents() + { + } + + public bool Exists + { + get { return false; } + } + + public IEnumerator GetEnumerator() + { + return Enumerable.Empty().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs new file mode 100644 index 00000000..2ea5fc59 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/Implementation/NotFoundFileInfo.cs @@ -0,0 +1,56 @@ +// 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.IO; + +namespace Microsoft.AspNet.FileProviders +{ + /// + /// Represents a non-existing file. + /// + public class NotFoundFileInfo : IFileInfo + { + private readonly string _name; + + public NotFoundFileInfo(string name) + { + _name = name; + } + + public bool Exists + { + get { return false; } + } + + public bool IsDirectory + { + get { return false; } + } + + public DateTimeOffset LastModified + { + get { return DateTimeOffset.MinValue; } + } + + public long Length + { + get { return -1; } + } + + public string Name + { + get { return _name; } + } + + public string PhysicalPath + { + get { return null; } + } + + public Stream CreateReadStream() + { + throw new InvalidOperationException(string.Format("The file {0} does not exist.", Name)); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj b/src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj new file mode 100644 index 00000000..de91540f --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/Microsoft.AspNet.FileProviders.Common.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 92c2c85c-d1a5-44bd-be23-238e08471b4d + + + + + + + + 2.0 + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders.Common/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.FileProviders.Common/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f5c6f4a8 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/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.Common/project.json b/src/Microsoft.AspNet.FileProviders.Common/project.json new file mode 100644 index 00000000..555ebd5f --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Common/project.json @@ -0,0 +1,16 @@ +{ + "version": "1.0.0-*", + "description": "Implementation of ASP.NET 5 file provider abstractions.", + "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.Embedded/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.FileProviders.Embedded/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f5c6f4a8 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Embedded/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.Embedded/project.json b/src/Microsoft.AspNet.FileProviders.Embedded/project.json new file mode 100644 index 00000000..039f4444 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Embedded/project.json @@ -0,0 +1,17 @@ +{ + "version": "1.0.0-*", + "description": "Implementation of ASP.NET 5 embedded file provider abstractions.", + "dependencies": { + "Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" } + }, + "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.Physical/project.json b/src/Microsoft.AspNet.FileProviders.Physical/project.json new file mode 100644 index 00000000..9f591934 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders.Physical/project.json @@ -0,0 +1,20 @@ +{ + "version": "1.0.0-*", + "description": "Implementation of ASP.NET 5 physical file provider abstractions.", + "dependencies": { + "Microsoft.AspNet.FileProviders.Common": { "version": "1.0.0-*", "type": "build" } + }, + "frameworks": { + "net45": { }, + "dnx451": { }, + "dnxcore50": { + "dependencies": { + "System.Collections.Concurrent": "4.0.10-beta-*", + "System.IO.FileSystem.Watcher": "4.0.0-beta-*", + "System.IO.FileSystem": "4.0.0-beta-*", + "System.Runtime.Extensions": "4.0.10-beta-*", + "System.Text.RegularExpressions": "4.0.10-beta-*", + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/Internal/NoopTrigger.cs b/src/Microsoft.AspNet.FileProviders/Internal/NoopTrigger.cs new file mode 100644 index 00000000..b7276b90 --- /dev/null +++ b/src/Microsoft.AspNet.FileProviders/Internal/NoopTrigger.cs @@ -0,0 +1,32 @@ +// 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 Microsoft.Framework.Expiration.Interfaces; + +namespace Microsoft.AspNet.FileProviders.Internal +{ + public class NoopTrigger : IExpirationTrigger + { + public static NoopTrigger Singleton { get; } = new NoopTrigger(); + + private NoopTrigger() + { + } + + public bool ActiveExpirationCallbacks + { + get { return false; } + } + + public bool IsExpired + { + get { return false; } + } + + public IDisposable RegisterExpirationCallback(Action callback, object state) + { + throw new InvalidOperationException("Trigger does not support registering change notifications."); + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FileProviders/project.json b/src/Microsoft.AspNet.FileProviders/project.json index 8f190b11..555ebd5f 100644 --- a/src/Microsoft.AspNet.FileProviders/project.json +++ b/src/Microsoft.AspNet.FileProviders/project.json @@ -9,15 +9,8 @@ "dnx451": { }, "dnxcore50": { "dependencies": { - "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-*" + "System.Linq": "4.0.0-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 100% rename from test/Microsoft.AspNet.FileProviders.Tests/PhysicalFileProviderTests.cs rename to test/Microsoft.AspNet.FileProviders.Physical.Tests/PhysicalFileProviderTests.cs 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