aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/HttpHandlers/PluginAssemblyHandler.cs
blob: 9e98f012d147534881972f9ce6a97f0c2a66dc62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.IO;
using System.Net;
using System.Threading.Tasks;
using MediaBrowser.Common.Net.Handlers;
using MediaBrowser.Controller;

namespace MediaBrowser.Api.HttpHandlers
{
    class PluginAssemblyHandler : BaseHandler
    {
        public override Task<string> GetContentType()
        {
            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);

            return new StaticFileHandler() { Path = path }.ProcessRequest(ctx);
        }
    }
}