2014-08-30 14:26:29 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Net
|
|
|
|
|
{
|
|
|
|
|
public class StaticResultOptions
|
|
|
|
|
{
|
|
|
|
|
public string ContentType { get; set; }
|
|
|
|
|
public TimeSpan? CacheDuration { get; set; }
|
|
|
|
|
public DateTime? DateLastModified { get; set; }
|
|
|
|
|
public Guid CacheKey { get; set; }
|
|
|
|
|
|
|
|
|
|
public Func<Task<Stream>> ContentFactory { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool IsHeadRequest { get; set; }
|
|
|
|
|
|
|
|
|
|
public IDictionary<string, string> ResponseHeaders { get; set; }
|
|
|
|
|
|
|
|
|
|
public bool Throttle { get; set; }
|
|
|
|
|
public long ThrottleLimit { get; set; }
|
|
|
|
|
public long MinThrottlePosition { get; set; }
|
2014-09-03 02:30:24 +00:00
|
|
|
|
public Func<long, long, long> ThrottleCallback { get; set; }
|
|
|
|
|
|
|
|
|
|
public Action OnComplete { get; set; }
|
2014-08-30 14:26:29 +00:00
|
|
|
|
|
|
|
|
|
public StaticResultOptions()
|
|
|
|
|
{
|
|
|
|
|
ResponseHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class StaticFileResultOptions : StaticResultOptions
|
|
|
|
|
{
|
|
|
|
|
public string Path { get; set; }
|
|
|
|
|
|
|
|
|
|
public FileShare FileShare { get; set; }
|
|
|
|
|
|
|
|
|
|
public StaticFileResultOptions()
|
|
|
|
|
{
|
|
|
|
|
FileShare = FileShare.Read;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|