dotnet-storage/OpenHarbor.Storage.Physical/PhysicalFileInfo.cs

29 lines
1009 B
C#
Raw Normal View History

using OpenHarbor.Storage.Abstractions;
2020-03-13 11:18:25 -04:00
using System;
using System.IO;
namespace OpenHarbor.Storage.Physical
2020-03-13 11:18:25 -04:00
{
public class PhysicalFileInfo : IFileInfo
{
private readonly FileInfo fileInfo;
public PhysicalFileInfo(FileInfo fileInfo)
{
this.fileInfo = fileInfo;
}
public string Path => fileInfo.FullName;
public string FileName => fileInfo.Name;
public string Extension => fileInfo.Extension;
public long FileSize => fileInfo.Length;
public DateTimeOffset? CreatedTime => fileInfo.CreationTime;
public DateTimeOffset? LastModifiedTime => fileInfo.LastWriteTime;
public DateTimeOffset? LastAccessTime => fileInfo.LastAccessTime;
public DateTime? CreatedTimeUtc => fileInfo.CreationTimeUtc;
public DateTime? LastModifiedTimeUtc => fileInfo.LastWriteTimeUtc;
public DateTime? LastAccessTimeUtc => fileInfo.LastAccessTimeUtc;
public bool IsDirectory => false;
}
}