mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
VirtualPathProvider returns App Relative path for ListXxx
This is cleaner than returning absolute virtual path. --HG-- branch : dev
This commit is contained in:
parent
1b020c6c8a
commit
27c945d498
@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
|
||||
namespace Orchard.FileSystems.VirtualPath {
|
||||
@ -11,11 +12,21 @@ namespace Orchard.FileSystems.VirtualPath {
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListFiles(string path) {
|
||||
return HostingEnvironment.VirtualPathProvider.GetDirectory(path).Files.OfType<VirtualFile>().Select(f => f.VirtualPath);
|
||||
return HostingEnvironment
|
||||
.VirtualPathProvider
|
||||
.GetDirectory(path)
|
||||
.Files
|
||||
.OfType<VirtualFile>()
|
||||
.Select(f => VirtualPathUtility.ToAppRelative(f.VirtualPath));
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListDirectories(string path) {
|
||||
return HostingEnvironment.VirtualPathProvider.GetDirectory(path).Directories.OfType<VirtualDirectory>().Select(d => d.VirtualPath);
|
||||
return HostingEnvironment
|
||||
.VirtualPathProvider
|
||||
.GetDirectory(path)
|
||||
.Directories
|
||||
.OfType<VirtualDirectory>()
|
||||
.Select(d => VirtualPathUtility.ToAppRelative(d.VirtualPath));
|
||||
}
|
||||
|
||||
public string Combine(params string[] paths) {
|
||||
|
Loading…
Reference in New Issue
Block a user