From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- MediaBrowser.Controller/Net/IHttpResultFactory.cs | 80 +++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 MediaBrowser.Controller/Net/IHttpResultFactory.cs (limited to 'MediaBrowser.Controller/Net/IHttpResultFactory.cs') diff --git a/MediaBrowser.Controller/Net/IHttpResultFactory.cs b/MediaBrowser.Controller/Net/IHttpResultFactory.cs new file mode 100644 index 000000000..f8e631de3 --- /dev/null +++ b/MediaBrowser.Controller/Net/IHttpResultFactory.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +using MediaBrowser.Model.IO; +using MediaBrowser.Model.Services; + +namespace MediaBrowser.Controller.Net +{ + /// + /// Interface IHttpResultFactory + /// + public interface IHttpResultFactory + { + /// + /// Gets the result. + /// + /// The content. + /// Type of the content. + /// The response headers. + /// System.Object. + object GetResult(string content, string contentType, IDictionary responseHeaders = null); + + object GetResult(IRequest requestContext, byte[] content, string contentType, IDictionary responseHeaders = null); + object GetResult(IRequest requestContext, Stream content, string contentType, IDictionary responseHeaders = null); + object GetResult(IRequest requestContext, string content, string contentType, IDictionary responseHeaders = null); + + object GetRedirectResult(string url); + + object GetResult(IRequest requestContext, T result, IDictionary responseHeaders = null) + where T : class; + + /// + /// Gets the static result. + /// + /// The request context. + /// The cache key. + /// The last date modified. + /// Duration of the cache. + /// Type of the content. + /// The factory fn. + /// The response headers. + /// if set to true [is head request]. + /// System.Object. + Task GetStaticResult(IRequest requestContext, + Guid cacheKey, + DateTime? lastDateModified, + TimeSpan? cacheDuration, + string contentType, Func> factoryFn, + IDictionary responseHeaders = null, + bool isHeadRequest = false); + + /// + /// Gets the static result. + /// + /// The request context. + /// The options. + /// System.Object. + Task GetStaticResult(IRequest requestContext, StaticResultOptions options); + + /// + /// Gets the static file result. + /// + /// The request context. + /// The path. + /// The file share. + /// System.Object. + Task GetStaticFileResult(IRequest requestContext, string path, FileShareMode fileShare = FileShareMode.Read); + + /// + /// Gets the static file result. + /// + /// The request context. + /// The options. + /// System.Object. + Task GetStaticFileResult(IRequest requestContext, + StaticFileResultOptions options); + } +} -- cgit v1.2.3