mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
#18270: IVirtualPathProvider delete method
Work Item: 18270 --HG-- branch : 1.x
This commit is contained in:
@@ -89,6 +89,10 @@ namespace Orchard.Tests.DisplayManagement.Descriptors {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteFile(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool DirectoryExists(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -97,6 +101,10 @@ namespace Orchard.Tests.DisplayManagement.Descriptors {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual void DeleteDirectory(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public string GetDirectoryName(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -86,6 +86,10 @@ namespace Orchard.Tests.DisplayManagement.Descriptors {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteFile(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool DirectoryExists(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -98,6 +102,10 @@ namespace Orchard.Tests.DisplayManagement.Descriptors {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteDirectory(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<string> ListFiles(string path) {
|
||||
return TestViewEngine.Keys.Select(o => o.ToString());
|
||||
}
|
||||
|
||||
@@ -78,6 +78,10 @@ namespace Orchard.Tests.Stubs {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void DeleteFile(string virtualPath) {
|
||||
_fileSystem.DeleteFile(ToFileSystemPath(virtualPath));
|
||||
}
|
||||
|
||||
public bool DirectoryExists(string virtualPath) {
|
||||
return _fileSystem.GetDirectoryEntry(ToFileSystemPath(virtualPath)) != null;
|
||||
}
|
||||
@@ -86,6 +90,10 @@ namespace Orchard.Tests.Stubs {
|
||||
_fileSystem.CreateDirectoryEntry(ToFileSystemPath(virtualPath));
|
||||
}
|
||||
|
||||
public void DeleteDirectory(string virtualPath) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public string GetDirectoryName(string virtualPath) {
|
||||
return Path.GetDirectoryName(virtualPath);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Orchard.FileSystems.VirtualPath {
|
||||
/// Note: This method doesn't detect all cases of malformed paths, it merely checks
|
||||
/// for *some* cases of malformed paths, so this is not a replacement for full virtual path
|
||||
/// verification through VirtualPathUtilty methods.
|
||||
/// In other wors, !IsMalformed does *not* imply "IsWellformed".
|
||||
/// In other words, !IsMalformed does *not* imply "IsWellformed".
|
||||
/// </summary>
|
||||
public bool IsMalformedVirtualPath(string virtualPath) {
|
||||
if (string.IsNullOrEmpty(virtualPath))
|
||||
@@ -137,6 +137,10 @@ namespace Orchard.FileSystems.VirtualPath {
|
||||
return HostingEnvironment.VirtualPathProvider.GetFileHash(virtualPath, dependencies);
|
||||
}
|
||||
|
||||
public virtual void DeleteFile(string virtualPath) {
|
||||
File.Delete(MapPath(virtualPath));
|
||||
}
|
||||
|
||||
public virtual string MapPath(string virtualPath) {
|
||||
return HostingEnvironment.MapPath(virtualPath);
|
||||
}
|
||||
@@ -165,5 +169,9 @@ namespace Orchard.FileSystems.VirtualPath {
|
||||
public virtual void CreateDirectory(string virtualPath) {
|
||||
Directory.CreateDirectory(MapPath(virtualPath));
|
||||
}
|
||||
|
||||
public virtual void DeleteDirectory(string virtualPath) {
|
||||
Directory.Delete(MapPath(virtualPath));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,10 +17,12 @@ namespace Orchard.FileSystems.VirtualPath {
|
||||
DateTime GetFileLastWriteTimeUtc(string virtualPath);
|
||||
string GetFileHash(string virtualPath);
|
||||
string GetFileHash(string virtualPath, IEnumerable<string> dependencies);
|
||||
void DeleteFile(string virtualPath);
|
||||
|
||||
bool DirectoryExists(string virtualPath);
|
||||
void CreateDirectory(string virtualPath);
|
||||
string GetDirectoryName(string virtualPath);
|
||||
void DeleteDirectory(string virtualPath);
|
||||
|
||||
IEnumerable<string> ListFiles(string path);
|
||||
IEnumerable<string> ListDirectories(string path);
|
||||
|
||||
Reference in New Issue
Block a user