Skip to content

Commit 6ef27cf

Browse files
committed
Merge branch 'develop'
2 parents 3c2c69f + 75427f4 commit 6ef27cf

File tree

10 files changed

+194
-86
lines changed

10 files changed

+194
-86
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ In `Web.config` create the new application keys and post fix each key with the `
133133
<add key="AzureBlobFileSystem.RootUrl:media" value="http://[myAccountName].blob.core.windows.net/" />
134134
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
135135
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
136-
<add key="AzureBlobFileSystem.UsePrivateContainer" value="false" />
136+
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />
137137
```
138138

139139
## Virtual Path Provider

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
os: Visual Studio 2015
22

33
# Version format
4-
version: 0.5.8.{build}
4+
version: 0.5.9.{build}
55

66
cache:
77
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
@@ -37,7 +37,7 @@ deploy:
3737
# GitHub Deployment for releases
3838
- provider: GitHub
3939
auth_token:
40-
secure: RH8UIklPiSC24UnsDFEHx5AHsMbpyLcYOKA4/ZnTsSc=
40+
secure: gnJNHw3btYiQ7G0GexIGpSyA3moAz/GuJvgGZvJmz63/+YVLFC+qew/xlniRLDSk
4141
artifact: /.*\.zip/ # upload all Zip packages to release assets
4242
draft: false
4343
prerelease: false

src/UmbracoFileSystemProviders.Azure.Installer/Configurator/Views/Configure.ascx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<%@ Control Language="c#" AutoEventWireup="True" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
22

3-
<script src="/umbraco/lib/angular/1.1.5/angular.min.js"></script>
4-
<script src="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Controllers/Configure.js"></script>
3+
<script src="~/umbraco/lib/angular/1.1.5/angular.min.js"></script>
4+
<script src="~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Controllers/Configure.js"></script>
55

66
<div ng-app ="UFSPLoader">
77
<div ng-controller="Loader">
88
<div class="row">
99
<div class="span1">
10-
<img src="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/azure-logo-32.png"/>
10+
<img src="~/App_Plugins/UmbracoFileSystemProviders/Azure/Install/azure-logo-32.png"/>
1111
</div>
1212
<div><h4>Umbraco Azure File System Provider</h4></div>
1313
</div>

src/UmbracoFileSystemProviders.Azure.Tests/AzureBlobFileSystemTestsBase.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ public class AzureBlobFileSystemTestsBase
2424
/// Creates an instance of <see cref="AzureBlobFileSystem"/> set up for developmental testing.
2525
/// </summary>
2626
/// <param name="disableVirtualPathProvider">Whether to disable the virtual path provider.</param>
27+
/// <param name="appVirtualPath">Mocked virtual path of application</param>
2728
/// <returns>
2829
/// The <see cref="AzureBlobFileSystem"/>.
2930
/// </returns>
30-
public AzureBlobFileSystem CreateAzureBlobFileSystem(bool disableVirtualPathProvider = false)
31+
public AzureBlobFileSystem CreateAzureBlobFileSystem(bool disableVirtualPathProvider = false, string appVirtualPath = "")
3132
{
3233
string containerName = "media";
3334
string rootUrl = "http://127.0.0.1:10000/devstoreaccount1/";
@@ -45,7 +46,8 @@ public AzureBlobFileSystem CreateAzureBlobFileSystem(bool disableVirtualPathProv
4546
{
4647
LogHelper = logHelper.Object,
4748
MimeTypeResolver = mimeTypeHelper.Object,
48-
DisableVirtualPathProvider = disableVirtualPathProvider
49+
DisableVirtualPathProvider = disableVirtualPathProvider,
50+
ApplicationVirtualPath = appVirtualPath
4951
}
5052
};
5153
}
@@ -99,6 +101,23 @@ public void ResolveRelativePath()
99101
Assert.AreEqual("/media/1010/media.jpg", actual);
100102
}
101103

104+
105+
/// <summary>
106+
/// Asserts that the file system correctly resolves the relative path when Umbraco is hosted in virtual path
107+
/// </summary>
108+
[Test]
109+
public void ResolveRelativePathWithAppVirtualPath()
110+
{
111+
// Arrange
112+
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem(false, "/test");
113+
114+
// Act
115+
string actual = provider.GetRelativePath("1010/media.jpg");
116+
117+
// Assert
118+
Assert.AreEqual("/test/media/1010/media.jpg", actual);
119+
}
120+
102121
/// <summary>
103122
/// Asserts that the file system correctly resolves the relative path
104123
/// when the input has been prefixed.

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@
141141
<HintPath>..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
142142
<Private>True</Private>
143143
</Reference>
144-
<Reference Include="nunit.framework">
145-
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
144+
<Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
145+
<HintPath>..\packages\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
146146
</Reference>
147147
<Reference Include="SQLCE4Umbraco, Version=1.0.5443.21810, Culture=neutral, processorArchitecture=MSIL">
148148
<HintPath>..\packages\UmbracoCms.Core.7.1.9\lib\SQLCE4Umbraco.dll</HintPath>
@@ -280,6 +280,9 @@
280280
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
281281
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
282282
</ItemGroup>
283+
<ItemGroup>
284+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
285+
</ItemGroup>
283286
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
284287
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
285288
Other similar extension points exist, see Microsoft.Common.targets.

src/UmbracoFileSystemProviders.Azure.Tests/packages.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
<package id="Moq" version="4.2.1502.0911" targetFramework="net45" />
2828
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
2929
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
30-
<package id="NUnit" version="2.6.4" targetFramework="net45" />
30+
<package id="NUnit" version="3.6.1" targetFramework="net45" />
31+
<package id="NUnit3TestAdapter" version="3.7.0" targetFramework="net45" />
3132
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
3233
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
3334
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />

src/UmbracoFileSystemProviders.Azure/AzureBlobFileSystem.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ public AzureBlobFileSystem(string containerName, string rootUrl, string connecti
5858
{
5959
}
6060

61+
/// <summary>
62+
/// Initializes a new instance of the <see cref="AzureBlobFileSystem"/> class.
63+
/// </summary>
64+
/// <param name="containerName">The container name.</param>
65+
/// <param name="rootUrl">The root url.</param>
66+
/// <param name="connectionString">The connection string.</param>
67+
/// <param name="maxDays">The maximum number of days to cache blob items for in the browser.</param>
68+
public AzureBlobFileSystem(string containerName, string rootUrl, string connectionString, string maxDays)
69+
: this(containerName, rootUrl, connectionString, maxDays, "true", "false")
70+
{
71+
}
72+
6173
/// <summary>
6274
/// Initializes a new instance of the <see cref="AzureBlobFileSystem"/> class.
6375
/// </summary>
@@ -334,4 +346,4 @@ public Stream OpenFile(string path)
334346
return this.FileSystem.OpenFile(path);
335347
}
336348
}
337-
}
349+
}

0 commit comments

Comments
 (0)