56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
namespace Notes;
|
|
|
|
public static class FileSystem
|
|
{
|
|
public static IFileService fileService { get; set; } = null!;
|
|
|
|
public static string Combine(string args0, string args1)
|
|
{
|
|
return fileService.Combine(args0, args1);
|
|
}
|
|
|
|
public static string GetRandomFileName()
|
|
{
|
|
return fileService.GetRandomFileName();
|
|
}
|
|
|
|
public static IEnumerable<string> EnumerateFiles(string path, string patten)
|
|
{
|
|
return fileService.EnumerateFiles(path, patten);
|
|
}
|
|
|
|
public static string GetFileName(string filename)
|
|
{
|
|
return fileService.GetFileName(filename);
|
|
}
|
|
|
|
public static string ReadAllText(string filename)
|
|
{
|
|
return fileService.ReadAllText(filename);
|
|
}
|
|
|
|
public static DateTime GetLastWriteTime(string filename)
|
|
{
|
|
return fileService.GetLastWriteTime(filename);
|
|
}
|
|
|
|
public static bool ExistsFile(string filename)
|
|
{
|
|
return fileService.ExistsFile(filename);
|
|
}
|
|
|
|
public static void Delete(string filename)
|
|
{
|
|
fileService.Delete(filename);
|
|
}
|
|
|
|
public static void WriteAllText(string path, string text)
|
|
{
|
|
fileService.WriteAllText(path, text);
|
|
}
|
|
|
|
public static void EnsureDirectory(string path, bool isFile =true)
|
|
{
|
|
fileService.EnsureDirectory(path,isFile);
|
|
}
|
|
} |