Fixing storage client issue for Azure

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2011-09-22 13:04:53 -07:00
parent 70bdfc3518
commit 687cdff569

View File

@@ -345,21 +345,27 @@ namespace Orchard.Azure {
} }
public string GetPath() { public string GetPath() {
using (new HttpContextWeaver()) {
return _blob.Uri.ToString().Substring(_rootPath.Length).Trim('/'); return _blob.Uri.ToString().Substring(_rootPath.Length).Trim('/');
} }
}
public long GetSize() { public long GetSize() {
using (new HttpContextWeaver()) {
return GetDirectorySize(_blob); return GetDirectorySize(_blob);
} }
}
public DateTime GetLastUpdated() { public DateTime GetLastUpdated() {
return DateTime.MinValue; return DateTime.MinValue;
} }
public IStorageFolder GetParent() { public IStorageFolder GetParent() {
using (new HttpContextWeaver()) {
if (_blob.Parent != null) { if (_blob.Parent != null) {
return new AzureBlobFolderStorage(_blob.Parent, _rootPath); return new AzureBlobFolderStorage(_blob.Parent, _rootPath);
} }
}
throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory"); throw new ArgumentException("Directory " + _blob.Uri + " does not have a parent directory");
} }