using Microsoft.Extensions.FileProviders;
namespace Finch.FileStorage;
public class PhysicalFileMeta : IFileMeta
{
///
public string Name { get; }
///
public string Path { get; }
///
public string AbsolutePath { get; }
///
public string DirectoryPath { get; }
///
public long Length { get; }
///
public DateTimeOffset LastModifiedDate { get; }
///
public bool IsDirectory { get; }
///
public Dictionary Properties { get; }
public PhysicalFileMeta(IFileInfo fileInfo, string path)
{
Path = path;
AbsolutePath = fileInfo.PhysicalPath;
Name = fileInfo.Name;
DirectoryPath = path.Substring(0, path.Length - fileInfo.Name.Length).TrimEnd('/');
LastModifiedDate = fileInfo.LastModified;
Length = fileInfo.Length;
IsDirectory = fileInfo.IsDirectory;
Properties = new();
}
}