mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using Orchard.Caching;
|
|
using Orchard.FileSystems.WebSite;
|
|
|
|
namespace Orchard.Tests.Stubs {
|
|
public class StubWebSiteFolder : IWebSiteFolder {
|
|
public IEnumerable<string> ListDirectories(string path) {
|
|
if (!Directory.Exists(path))
|
|
return Enumerable.Empty<string>();
|
|
|
|
return Directory.GetDirectories(path);
|
|
}
|
|
|
|
public IEnumerable<string> ListFiles(string path, bool recursive) {
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public bool FileExists(string virtualPath) {
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public string ReadFile(string path) {
|
|
return ReadFile(path, false);
|
|
}
|
|
|
|
public string ReadFile(string path, bool actualContent) {
|
|
if (!File.Exists(path))
|
|
return null;
|
|
|
|
return File.ReadAllText(path);
|
|
}
|
|
|
|
public void CopyFileTo(string virtualPath, Stream destination) {
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void CopyFileTo(string virtualPath, Stream destination, bool actualContent) {
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public IVolatileToken WhenPathChanges(string path) {
|
|
return new Token {IsCurrent = true};
|
|
}
|
|
|
|
public class Token : IVolatileToken {
|
|
public bool IsCurrent { get; set; }
|
|
}
|
|
}
|
|
} |