PluginAssemblyHandler.cs 898 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.IO;
  3. using System.Net;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Common.Net.Handlers;
  6. using MediaBrowser.Controller;
  7. namespace MediaBrowser.Api.HttpHandlers
  8. {
  9. class PluginAssemblyHandler : BaseHandler
  10. {
  11. public override Task<string> GetContentType()
  12. {
  13. throw new NotImplementedException();
  14. }
  15. protected override Task WriteResponseToOutputStream(Stream stream)
  16. {
  17. throw new NotImplementedException();
  18. }
  19. public override Task ProcessRequest(HttpListenerContext ctx)
  20. {
  21. string filename = ctx.Request.QueryString["assemblyfilename"];
  22. string path = Path.Combine(Kernel.Instance.ApplicationPaths.PluginsPath, filename);
  23. return new StaticFileHandler() { Path = path }.ProcessRequest(ctx);
  24. }
  25. }
  26. }