aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Net/StaticResultOptions.cs
blob: 7a179913ac329d91541c0b9d3905badd3d479946 (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
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

using MediaBrowser.Model.IO;

namespace MediaBrowser.Controller.Net
{
    public class StaticResultOptions
    {
        public string ContentType { get; set; }
        public TimeSpan? CacheDuration { get; set; }
        public DateTime? DateLastModified { get; set; }
        public Func<Task<Stream>> ContentFactory { get; set; }

        public bool IsHeadRequest { get; set; }

        public IDictionary<string, string> ResponseHeaders { get; set; }

        public Action OnComplete { get; set; }
        public Action OnError { get; set; }

        public string Path { get; set; }
        public long? ContentLength { get; set; }

        public FileShareMode FileShare { get; set; }

        public StaticResultOptions()
        {
            ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            FileShare = FileShareMode.Read;
        }
    }

    public class StaticFileResultOptions : StaticResultOptions
    {
    }
}