jellyfin/MediaBrowser.Api/HttpHandlers/PluginAssemblyHandler.cs

39 lines
1.1 KiB
C#
Raw Normal View History

using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;
using System;
using System.ComponentModel.Composition;
2012-09-03 19:12:02 +00:00
using System.IO;
using System.Net;
using System.Threading.Tasks;
namespace MediaBrowser.Api.HttpHandlers
{
[Export(typeof(BaseHandler))]
2012-09-03 19:12:02 +00:00
class PluginAssemblyHandler : BaseHandler
{
public override bool HandlesRequest(HttpListenerRequest request)
{
return ApiService.IsApiUrlMatch("pluginassembly", request);
}
protected override Task<ResponseInfo> GetResponseInfo()
2012-09-03 19:12:02 +00:00
{
throw new NotImplementedException();
}
protected override Task WriteResponseToOutputStream(Stream stream)
{
throw new NotImplementedException();
}
public override Task ProcessRequest(HttpListenerContext ctx)
{
string filename = ctx.Request.QueryString["assemblyfilename"];
string path = Path.Combine(Kernel.Instance.ApplicationPaths.PluginsPath, filename);
2012-09-11 18:20:12 +00:00
return new StaticFileHandler { Path = path }.ProcessRequest(ctx);
2012-09-03 19:12:02 +00:00
}
}
}