Update of code when media folder not exist a media directory is created. If this fails exceptions is trown.

This commit is contained in:
Robert Jansz
2010-02-22 22:36:58 +01:00
parent 20fcc48ccf
commit c479dbb96c

View File

@@ -28,7 +28,12 @@ namespace Orchard.Storage {
public IEnumerable<IStorageFolder> ListFolders(string path) {
if (!Directory.Exists(path)) {
throw new ArgumentException("Directory " + path + " does not exist");
try {
Directory.CreateDirectory(path);
}
catch (Exception ex) {
throw new ArgumentException(string.Format("The folder could not be created at path: {0}. {1}",path,ex));
}
}
return new DirectoryInfo(path)