Files
2022-12-06 17:26:27 +08:00

34 lines
791 B
C#

using System;
using System.IO;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Jellyfin.Plugin.Danmu.Core;
public class FileSystem : IFileSystem
{
public Task WriteAllBytesAsync(string path, byte[] bytes, CancellationToken cancellationToken = default)
{
return File.WriteAllBytesAsync(path, bytes, cancellationToken);
}
public Task WriteAllTextAsync(string path, string? contents, Encoding encoding, CancellationToken cancellationToken = default)
{
return File.WriteAllTextAsync(path, contents, cancellationToken);
}
public DateTime GetLastWriteTime(string path)
{
return File.GetLastWriteTime(path);
}
public bool Exists(string? path)
{
return File.Exists(path);
}
}