Skip to content

Commit 3e48bb7

Browse files
Merge pull request #34 from JimBobSquarePants/revert-33-CDN
Revert "Added Cdn & fixed tests accordingly"
2 parents 6f6f478 + a6b916c commit 3e48bb7

File tree

9 files changed

+18
-61
lines changed

9 files changed

+18
-61
lines changed

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public InstallerStatus PostParameters(IEnumerable<Parameter> parameters)
6565
var connection = parameters.SingleOrDefault(k => k.Key == "connectionString").Value;
6666
var containerName = parameters.SingleOrDefault(k => k.Key == "containerName").Value;
6767
var rootUrl = parameters.SingleOrDefault(k => k.Key == "rootUrl").Value;
68-
var cdnUrl = parameters.SingleOrDefault(k => k.Key == "cdnUrl").Value;
6968

7069
if (!TestAzureCredentials(connection, containerName))
7170
{

src/UmbracoFileSystemProviders.Azure.Installer/Properties/VersionInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//
1515
// You can specify all the values or you can default the Build and Revision Numbers
1616
// by using the '*' as shown below:
17-
// [assembly: AssemblyVersion("0.5.2.1")]
18-
[assembly: AssemblyVersion("0.5.2.1")]
19-
[assembly: AssemblyFileVersion("0.5.2.1")]
20-
[assembly: AssemblyInformationalVersion("0.5.2-alpha")]
17+
// [assembly: AssemblyVersion("0.5.0.10")]
18+
[assembly: AssemblyVersion("0.5.0.0")]
19+
[assembly: AssemblyFileVersion("0.5.0.0")]
20+
[assembly: AssemblyInformationalVersion("0.5.0")]

src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.config.install.xdt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</Provider>
99

1010
<Provider alias="media" type="Our.Umbraco.FileSystemProviders.Azure.AzureBlobFileSystem, Our.Umbraco.FileSystemProviders.Azure" xdt:Locator="Match(type)" xdt:Transform="InsertIfMissing">
11-
<Parameters xdt:Transform="InsertIfMissing">
11+
<Parameters xdt:Transform="InsertIfMissing">
1212
<add key="containerName" value="media" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
1313
<add key="rootUrl" value="http://[myAccountName].blob.core.windows.net/" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
1414
<add key="connectionString" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
@@ -17,7 +17,6 @@
1717
Defaults to 365 days.
1818
-->
1919
<add key="maxDays" value="365" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
20-
<add key="cdnUrl" value="[myCDN].azureedge.net" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
2120
</Parameters>
2221
</Provider>
2322
<!--

src/UmbracoFileSystemProviders.Azure.Tests/FileSystemProviders.upgrade.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
Defaults to 365 days.
1414
-->
1515
<add key="maxDays" value="365"/>
16-
<add key="cdnUrl" value="[myCDN].azureedge.net" />
1716
</Parameters>
1817
</Provider>
1918

src/UmbracoFileSystemProviders.Azure.Tests/InstallerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void CheckXdtFirstParameterKey()
2525
public void CheckXdtNumberOfParameters()
2626
{
2727
var parameters = InstallerController.GetParametersFromXml("FileSystemProviders.config.install.xdt");
28-
Assert.AreEqual(5, parameters.Count());
28+
Assert.AreEqual(4, parameters.Count());
2929
}
3030

3131
[Test]

src/UmbracoFileSystemProviders.Azure.Tests/UmbracoFileSystemProviders.Azure.Tests.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@
276276
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
277277
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0-beta014\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
278278
</ItemGroup>
279-
<ItemGroup>
280-
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
281-
</ItemGroup>
282279
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
283280
<Import Project="..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets" Condition="Exists('..\packages\StyleCop.Analyzers.1.0.0-beta014\build\StyleCop.Analyzers.targets')" />
284281
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

src/UmbracoFileSystemProviders.Azure/AzureBlobFileSystem.cs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class AzureBlobFileSystem : IFileSystem
2424
/// <param name="containerName">The container name.</param>
2525
/// <param name="rootUrl">The root url.</param>
2626
/// <param name="connectionString">The connection string.</param>
27-
public AzureBlobFileSystem(string containerName, string rootUrl, string connectionString)
28-
: this(containerName, rootUrl, connectionString, "365", string.Empty)
27+
public AzureBlobFileSystem(string containerName, string rootUrl, string connectionString) :
28+
this(containerName, rootUrl, connectionString, "365")
2929
{
3030
}
3131

@@ -37,21 +37,8 @@ public AzureBlobFileSystem(string containerName, string rootUrl, string connecti
3737
/// <param name="connectionString">The connection string.</param>
3838
/// <param name="maxDays">The maximum number of days to cache blob items for in the browser.</param>
3939
public AzureBlobFileSystem(string containerName, string rootUrl, string connectionString, string maxDays)
40-
: this(containerName, rootUrl, connectionString, maxDays, string.Empty)
4140
{
42-
}
43-
44-
/// <summary>
45-
/// Initializes a new instance of the <see cref="AzureBlobFileSystem"/> class.
46-
/// </summary>
47-
/// <param name="containerName">The container name.</param>
48-
/// <param name="rootUrl">The root url.</param>
49-
/// <param name="connectionString">The connection string.</param>
50-
/// <param name="maxDays">The maximum number of days to cache blob items for in the browser.</param>
51-
/// <param name="cdnUrl">Url to the CDN on which you wish to expose the ressource</param>
52-
public AzureBlobFileSystem(string containerName, string rootUrl, string connectionString, string maxDays, string cdnUrl)
53-
{
54-
this.FileSystem = AzureFileSystem.GetInstance(containerName, rootUrl, connectionString, maxDays, cdnUrl);
41+
this.FileSystem = AzureFileSystem.GetInstance(containerName, rootUrl, connectionString, maxDays);
5542
}
5643

5744
/// <summary>

src/UmbracoFileSystemProviders.Azure/AzureFileSystem.cs

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ internal class AzureFileSystem : IFileSystem
6262
/// </summary>
6363
private readonly string rootUrl;
6464

65-
/// <summary>
66-
/// The url of the CDN
67-
/// </summary>
68-
private readonly string cdnUrl;
69-
7065
/// <summary>
7166
/// The cloud media blob container.
7267
/// </summary>
@@ -82,7 +77,7 @@ internal class AzureFileSystem : IFileSystem
8277
/// <exception cref="ArgumentNullException">
8378
/// Thrown if <paramref name="containerName"/> is null or whitespace.
8479
/// </exception>
85-
private AzureFileSystem(string containerName, string rootUrl, string connectionString, int maxDays, string cdnUrl)
80+
private AzureFileSystem(string containerName, string rootUrl, string connectionString, int maxDays)
8681
{
8782
if (string.IsNullOrWhiteSpace(containerName))
8883
{
@@ -116,19 +111,10 @@ private AzureFileSystem(string containerName, string rootUrl, string connectionS
116111
rootUrl = rootUrl.Trim() + "/";
117112
}
118113

119-
if (!string.IsNullOrEmpty(cdnUrl))
120-
{
121-
if (!cdnUrl.Trim().EndsWith("/"))
122-
{
123-
cdnUrl = cdnUrl.Trim() + "/";
124-
}
125-
126-
this.cdnUrl = cdnUrl + containerName + "/";
127-
}
128-
129114
this.rootUrl = rootUrl + containerName + "/";
130115
this.ContainerName = containerName;
131116
this.MaxDays = maxDays;
117+
132118
this.LogHelper = new WrappedLogHelper();
133119
this.MimeTypeResolver = new MimeTypeResolver();
134120
}
@@ -160,9 +146,8 @@ private AzureFileSystem(string containerName, string rootUrl, string connectionS
160146
/// <param name="rootUrl">The root url.</param>
161147
/// <param name="connectionString">The connection string.</param>
162148
/// <param name="maxDays">The maximum number of days to cache blob items for in the browser.</param>
163-
/// <param name="cdnUrl">Url to the CDN</param>
164149
/// <returns>The <see cref="AzureFileSystem"/></returns>
165-
public static AzureFileSystem GetInstance(string containerName, string rootUrl, string connectionString, string maxDays, string cdnUrl)
150+
public static AzureFileSystem GetInstance(string containerName, string rootUrl, string connectionString, string maxDays)
166151
{
167152
lock (Locker)
168153
{
@@ -174,7 +159,7 @@ public static AzureFileSystem GetInstance(string containerName, string rootUrl,
174159
max = 365;
175160
}
176161

177-
fileSystem = new AzureFileSystem(containerName, rootUrl, connectionString, max, cdnUrl);
162+
fileSystem = new AzureFileSystem(containerName, rootUrl, connectionString, max);
178163
}
179164

180165
return fileSystem;
@@ -571,16 +556,7 @@ private CloudBlobDirectory GetDirectoryReference(string path)
571556
private string ResolveUrl(string path, bool relative)
572557
{
573558
// First create the full url
574-
Uri url;
575-
576-
if (!string.IsNullOrEmpty(this.cdnUrl))
577-
{
578-
url = new Uri(new Uri(this.cdnUrl, UriKind.Absolute), this.FixPath(path));
579-
}
580-
else
581-
{
582-
url = new Uri(new Uri(this.rootUrl, UriKind.Absolute), this.FixPath(path));
583-
}
559+
Uri url = new Uri(new Uri(this.rootUrl, UriKind.Absolute), this.FixPath(path));
584560

585561
if (!relative)
586562
{

src/UmbracoFileSystemProviders.Azure/Properties/VersionInfo.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//
1515
// You can specify all the values or you can default the Build and Revision Numbers
1616
// by using the '*' as shown below:
17-
// [assembly: AssemblyVersion("0.5.2.1")]
18-
[assembly: AssemblyVersion("0.5.2.1")]
19-
[assembly: AssemblyFileVersion("0.5.2.1")]
20-
[assembly: AssemblyInformationalVersion("0.5.2-alpha")]
17+
// [assembly: AssemblyVersion("0.5.0.10")]
18+
[assembly: AssemblyVersion("0.5.0.0")]
19+
[assembly: AssemblyFileVersion("0.5.0.0")]
20+
[assembly: AssemblyInformationalVersion("0.5.0")]

0 commit comments

Comments
 (0)