mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 02:44:52 +08:00
Fixing folder creation on Azure
--HG-- branch : 1.x
This commit is contained in:
@@ -165,6 +165,21 @@ namespace Orchard.Azure.Tests.FileSystems.Media {
|
||||
Assert.AreEqual(1, _azureBlobStorageProvider.ListFiles("folder1/folder4/folder3").Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(ArgumentException))]
|
||||
public void CannotCreateAlreadyExistingFolders()
|
||||
{
|
||||
_azureBlobStorageProvider.CreateFile("folder1/foo.txt");
|
||||
_azureBlobStorageProvider.CreateFolder("folder1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CanCreateAlreadyExistingFolder()
|
||||
{
|
||||
_azureBlobStorageProvider.CreateFile("folder1/foo.txt");
|
||||
_azureBlobStorageProvider.TryCreateFolder("folder1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldReadWriteFiles() {
|
||||
const string teststring = "This is a test string.";
|
||||
|
@@ -156,7 +156,13 @@ namespace Orchard.Azure {
|
||||
|
||||
public void TryCreateFolder(string path) {
|
||||
EnsurePathIsRelative(path);
|
||||
CreateFile(Combine(path, FolderEntry));
|
||||
using (new HttpContextWeaver()) {
|
||||
if (Container.DirectoryExists(String.Concat(_root, path))) {
|
||||
return;
|
||||
}
|
||||
|
||||
CreateFile(Combine(path, FolderEntry));
|
||||
}
|
||||
}
|
||||
|
||||
public void CreateFolder(string path) {
|
||||
|
Reference in New Issue
Block a user