Added IHttpResultFactory

This commit is contained in:
LukePulverenti 2013-03-08 12:25:25 -05:00
parent bf9f0bc534
commit 332f635939
5 changed files with 27 additions and 0 deletions

View File

@ -61,6 +61,7 @@
<Compile Include="IO\StreamDefaults.cs" /> <Compile Include="IO\StreamDefaults.cs" />
<Compile Include="Net\BasePeriodicWebSocketListener.cs" /> <Compile Include="Net\BasePeriodicWebSocketListener.cs" />
<Compile Include="Configuration\IApplicationPaths.cs" /> <Compile Include="Configuration\IApplicationPaths.cs" />
<Compile Include="Net\IHttpResultFactory.cs" />
<Compile Include="Net\IServerManager.cs" /> <Compile Include="Net\IServerManager.cs" />
<Compile Include="Net\IWebSocketListener.cs" /> <Compile Include="Net\IWebSocketListener.cs" />
<Compile Include="IApplicationHost.cs" /> <Compile Include="IApplicationHost.cs" />

View File

@ -0,0 +1,9 @@
using System.IO;
namespace MediaBrowser.Common.Net
{
public interface IHttpResultFactory
{
object GetResult(Stream stream, string contentType);
}
}

View File

@ -0,0 +1,14 @@
using MediaBrowser.Common.Net;
using ServiceStack.Common.Web;
using System.IO;
namespace MediaBrowser.Server.Implementations.HttpServer
{
public class HttpResultFactory : IHttpResultFactory
{
public object GetResult(Stream stream, string contentType)
{
return new HttpResult(stream, contentType);
}
}
}

View File

@ -106,6 +106,7 @@
<Compile Include="BdInfo\BdInfoExaminer.cs" /> <Compile Include="BdInfo\BdInfoExaminer.cs" />
<Compile Include="Configuration\ServerConfigurationManager.cs" /> <Compile Include="Configuration\ServerConfigurationManager.cs" />
<Compile Include="HttpServer\BaseRestService.cs" /> <Compile Include="HttpServer\BaseRestService.cs" />
<Compile Include="HttpServer\HttpResultFactory.cs" />
<Compile Include="HttpServer\HttpServer.cs" /> <Compile Include="HttpServer\HttpServer.cs" />
<Compile Include="HttpServer\NativeWebSocket.cs" /> <Compile Include="HttpServer\NativeWebSocket.cs" />
<Compile Include="HttpServer\ServerFactory.cs" /> <Compile Include="HttpServer\ServerFactory.cs" />

View File

@ -155,6 +155,8 @@ namespace MediaBrowser.ServerApplication
await base.RegisterResources().ConfigureAwait(false); await base.RegisterResources().ConfigureAwait(false);
RegisterSingleInstance<IHttpResultFactory>(new HttpResultFactory());
RegisterSingleInstance<IServerApplicationHost>(this); RegisterSingleInstance<IServerApplicationHost>(this);
RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths); RegisterSingleInstance<IServerApplicationPaths>(ApplicationPaths);