aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/IO
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-30 19:15:58 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-10-30 19:15:58 -0400
commit579b507f7fa322fdf8a746b6e787015d0567e2a6 (patch)
tree2e5c0d4a76e65d2928f4da9f2a625bfef4844640 /MediaBrowser.Controller/IO
parentd5baaa1f67975c21417ebaaa193e17192e1c3936 (diff)
use IFileSystem interface to get creation time
Diffstat (limited to 'MediaBrowser.Controller/IO')
-rw-r--r--MediaBrowser.Controller/IO/FileSystem.cs21
-rw-r--r--MediaBrowser.Controller/IO/IFileSystem.cs10
2 files changed, 9 insertions, 22 deletions
diff --git a/MediaBrowser.Controller/IO/FileSystem.cs b/MediaBrowser.Controller/IO/FileSystem.cs
index f31fc53de..b08e8da27 100644
--- a/MediaBrowser.Controller/IO/FileSystem.cs
+++ b/MediaBrowser.Controller/IO/FileSystem.cs
@@ -31,27 +31,6 @@ namespace MediaBrowser.Controller.IO
}
/// <summary>
- /// Gets the creation time UTC.
- /// </summary>
- /// <param name="info">The info.</param>
- /// <param name="logger">The logger.</param>
- /// <returns>DateTime.</returns>
- public static DateTime GetCreationTimeUtc(FileSystemInfo info, ILogger logger)
- {
- // This could throw an error on some file systems that have dates out of range
-
- try
- {
- return info.CreationTimeUtc;
- }
- catch (Exception ex)
- {
- logger.ErrorException("Error determining CreationTimeUtc for {0}", ex, info.FullName);
- return DateTime.MinValue;
- }
- }
-
- /// <summary>
/// Copies all.
/// </summary>
/// <param name="source">The source.</param>
diff --git a/MediaBrowser.Controller/IO/IFileSystem.cs b/MediaBrowser.Controller/IO/IFileSystem.cs
index 2654c3235..cbc5c7bf3 100644
--- a/MediaBrowser.Controller/IO/IFileSystem.cs
+++ b/MediaBrowser.Controller/IO/IFileSystem.cs
@@ -1,4 +1,5 @@
-using System.IO;
+using System;
+using System.IO;
namespace MediaBrowser.Controller.IO
{
@@ -41,5 +42,12 @@ namespace MediaBrowser.Controller.IO
/// <param name="filename">The filename.</param>
/// <returns>System.String.</returns>
string GetValidFilename(string filename);
+
+ /// <summary>
+ /// Gets the creation time UTC.
+ /// </summary>
+ /// <param name="info">The info.</param>
+ /// <returns>DateTime.</returns>
+ DateTime GetCreationTimeUtc(FileSystemInfo info);
}
}