shoko/Protocols/FileProtoHandler.cs

25 lines
471 B
C#
Raw Normal View History

2023-10-02 18:49:24 +00:00
namespace Shoko;
[Protocol("file")]
class FileProtoHandler : ProtoHandler
{
public FileProtoHandler(Uri url)
{
URL = url;
}
public override void Load()
{
var file = new UriBuilder(URL).Path;
var stream = new FileStream(file, FileMode.Open);
Content = stream;
MediaType = "text/plain"; // TODO: magic numbers
Status = "OK";
Loaded = true;
}
public override void Render()
{
}
}