aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
diff options
context:
space:
mode:
authorSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
committerSven Van den brande <sven.vandenbrande@outlook.com>2013-10-31 21:46:03 +0100
commite8f8d6651c86b3fd3350a5afae1d759fbbad06bd (patch)
tree6496b1525f0dfc448f0250f4fddaa634296ae94b /MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
parent28ab28768a307d1cac60ebe79163b98291068cde (diff)
parent882d0681e68c5e0ae663cca75752e4df765c8dd5 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
index 356c6fc4d..e6942fae6 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
+using MediaBrowser.Controller.IO;
using MediaBrowser.Model.Logging;
using ServiceStack.Common;
using ServiceStack.Common.Web;
@@ -25,13 +26,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// The _logger
/// </summary>
private readonly ILogger _logger;
+ private readonly IFileSystem _fileSystem;
/// <summary>
/// Initializes a new instance of the <see cref="HttpResultFactory"/> class.
/// </summary>
/// <param name="logManager">The log manager.</param>
- public HttpResultFactory(ILogManager logManager)
+ public HttpResultFactory(ILogManager logManager, IFileSystem fileSystem)
{
+ _fileSystem = fileSystem;
_logger = logManager.GetLogger("HttpResultFactory");
}
@@ -288,7 +291,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
throw new ArgumentException("FileShare must be either Read or ReadWrite");
}
- var dateModified = File.GetLastWriteTimeUtc(path);
+ var dateModified = _fileSystem.GetLastWriteTimeUtc(path);
var cacheKey = path + dateModified.Ticks;
@@ -303,7 +306,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
/// <returns>Stream.</returns>
private Stream GetFileStream(string path, FileShare fileShare)
{
- return new FileStream(path, FileMode.Open, FileAccess.Read, fileShare, StreamDefaults.DefaultFileStreamBufferSize, FileOptions.Asynchronous);
+ return _fileSystem.GetFileStream(path, FileMode.Open, FileAccess.Read, fileShare, true);
}
/// <summary>