Bye bye FileSystemProvider.config - we no longer use you

This commit is contained in:
Warren Buckley
2019-01-25 09:10:49 +00:00
parent 79eaeef258
commit bee2776035
11 changed files with 0 additions and 217 deletions

View File

@@ -1,67 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
public class FileSystemProviderElement : ConfigurationElement, IFileSystemProviderElement
{
private const string ALIAS_KEY = "alias";
private const string TYPE_KEY = "type";
private const string PARAMETERS_KEY = "Parameters";
[ConfigurationProperty(ALIAS_KEY, IsKey = true, IsRequired = true)]
public string Alias
{
get
{
return ((string)(base[ALIAS_KEY]));
}
}
[ConfigurationProperty(TYPE_KEY, IsKey = false, IsRequired = true)]
public string Type
{
get
{
return ((string)(base[TYPE_KEY]));
}
}
[ConfigurationProperty(PARAMETERS_KEY, IsDefaultCollection = true, IsRequired = false)]
public KeyValueConfigurationCollection Parameters
{
get
{
return ((KeyValueConfigurationCollection)(base[PARAMETERS_KEY]));
}
}
string IFileSystemProviderElement.Alias
{
get { return Alias; }
}
string IFileSystemProviderElement.Type
{
get { return Type; }
}
private IDictionary<string, string> _params;
IDictionary<string, string> IFileSystemProviderElement.Parameters
{
get
{
if (_params != null) return _params;
_params = new Dictionary<string, string>();
foreach (KeyValueConfigurationElement element in Parameters)
{
_params.Add(element.Key, element.Value);
}
return _params;
}
}
}
}

View File

@@ -1,43 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
[ConfigurationCollection(typeof(FileSystemProviderElement), AddItemName = "Provider")]
public class FileSystemProviderElementCollection : ConfigurationElementCollection, IEnumerable<IFileSystemProviderElement>
{
protected override ConfigurationElement CreateNewElement()
{
return new FileSystemProviderElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((FileSystemProviderElement)(element)).Alias;
}
public new FileSystemProviderElement this[string key]
{
get
{
return (FileSystemProviderElement)BaseGet(key);
}
}
IEnumerator<IFileSystemProviderElement> IEnumerable<IFileSystemProviderElement>.GetEnumerator()
{
for (var i = 0; i < Count; i++)
{
yield return BaseGet(i) as IFileSystemProviderElement;
}
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}

View File

@@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
namespace Umbraco.Core.Configuration
{
public class FileSystemProvidersSection : ConfigurationSection, IFileSystemProvidersSection
{
[ConfigurationProperty("", IsDefaultCollection = true, IsRequired = true)]
public FileSystemProviderElementCollection Providers
{
get { return ((FileSystemProviderElementCollection)(base[""])); }
}
private IDictionary<string, IFileSystemProviderElement> _providers;
IDictionary<string, IFileSystemProviderElement> IFileSystemProvidersSection.Providers
{
get
{
if (_providers != null) return _providers;
_providers = Providers.ToDictionary(x => x.Alias, x => x);
return _providers;
}
}
}
}

View File

@@ -1,11 +0,0 @@
using System.Collections.Generic;
namespace Umbraco.Core.Configuration
{
public interface IFileSystemProviderElement
{
string Alias { get; }
string Type { get; }
IDictionary<string, string> Parameters { get; }
}
}

View File

@@ -1,9 +0,0 @@
using System.Collections.Generic;
namespace Umbraco.Core.Configuration
{
public interface IFileSystemProvidersSection
{
IDictionary<string, IFileSystemProviderElement> Providers { get; }
}
}

View File

@@ -231,9 +231,6 @@
<Compile Include="Configuration\Dashboard\SectionElement.cs" />
<Compile Include="Configuration\Dashboard\TabCollection.cs" />
<Compile Include="Configuration\Dashboard\TabElement.cs" />
<Compile Include="Configuration\FileSystemProviderElement.cs" />
<Compile Include="Configuration\FileSystemProviderElementCollection.cs" />
<Compile Include="Configuration\FileSystemProvidersSection.cs" />
<Compile Include="Configuration\GlobalSettings.cs" />
<Compile Include="Configuration\GlobalSettingsExtensions.cs" />
<Compile Include="Configuration\Grid\GridConfig.cs" />
@@ -255,8 +252,6 @@
<Compile Include="Configuration\HealthChecks\NotificationMethodsElementCollection.cs" />
<Compile Include="Configuration\HealthChecks\NotificationMethodSettingsElement.cs" />
<Compile Include="Configuration\HealthChecks\NotificationMethodSettingsElementCollection.cs" />
<Compile Include="Configuration\IFileSystemProviderElement.cs" />
<Compile Include="Configuration\IFileSystemProvidersSection.cs" />
<Compile Include="Configuration\IGlobalSettings.cs" />
<Compile Include="Configuration\InnerTextConfigurationElement.cs" />
<Compile Include="Configuration\LocalTempStorage.cs" />

View File

@@ -1,25 +0,0 @@
using System;
using System.Configuration;
using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.UmbracoSettings;
namespace Umbraco.Tests.Configurations
{
[TestFixture]
public class FileSystemProviderTests
{
[Test]
public void Can_Get_Media_Provider()
{
var config = (FileSystemProvidersSection)ConfigurationManager.GetSection("umbracoConfiguration/FileSystemProviders");
var providerConfig = config.Providers["media"];
Assert.That(providerConfig, Is.Not.Null);
Assert.That(providerConfig.Parameters.AllKeys.Any(), Is.True);
}
}
}

View File

@@ -293,7 +293,6 @@
<Compile Include="Cache\WebCachingAppCacheTests.cs" />
<Compile Include="Cache\RuntimeAppCacheTests.cs" />
<Compile Include="Configurations\DashboardSettings\DashboardSettingsTests.cs" />
<Compile Include="Configurations\FileSystemProviderTests.cs" />
<Compile Include="Configurations\UmbracoSettings\ContentElementDefaultTests.cs" />
<Compile Include="Configurations\UmbracoSettings\ContentElementTests.cs" />
<Compile Include="Configurations\UmbracoSettings\LoggingElementDefaultTests.cs" />

View File

@@ -178,9 +178,6 @@
<Content Include="Config\imageprocessor\cache.config">
<SubType>Designer</SubType>
</Content>
<None Include="Config\FileSystemProviders.Release.config">
<DependentUpon>FileSystemProviders.config</DependentUpon>
</None>
<None Include="Config\EmbeddedMedia.Release.config">
<DependentUpon>EmbeddedMedia.config</DependentUpon>
</None>
@@ -314,7 +311,6 @@
<Content Include="Config\umbracoSettings.config">
<SubType>Designer</SubType>
</Content>
<Content Include="Config\FileSystemProviders.config" />
<Content Include="Config\EmbeddedMedia.config" />
<Content Include="Config\BackOfficeTours\getting-started.json" />
</ItemGroup>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<FileSystemProviders>
<!-- Media -->
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="virtualRoot" value="~/media/" />
</Parameters>
</Provider>
</FileSystemProviders>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0"?>
<FileSystemProviders>
<!-- Media -->
<Provider alias="media" type="Umbraco.Core.IO.PhysicalFileSystem, Umbraco.Core">
<Parameters>
<add key="virtualRoot" value="~/media/" />
</Parameters>
</Provider>
</FileSystemProviders>