create new file system (based on Orchard)

This commit is contained in:
2021-11-25 12:00:20 +01:00
parent 649791d648
commit bd024a0118
5 changed files with 419 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
using Microsoft.Extensions.FileProviders;
namespace zero.FileStorage;
public class PhysicalFileMeta : IFileMeta
{
/// <inheritdoc />
public string Path { get; }
/// <inheritdoc />
public string Name { get; }
/// <inheritdoc />
public string DirectoryPath { get; }
/// <inheritdoc />
public long Length { get; }
/// <inheritdoc />
public DateTimeOffset LastModifiedDate { get; }
/// <inheritdoc />
public bool IsDirectory { get; }
/// <inheritdoc />
public Dictionary<string, object> Properties { get; }
public PhysicalFileMeta(IFileInfo fileInfo, string path)
{
Path = path;
Name = fileInfo.Name;
DirectoryPath = path.Substring(0, path.Length - fileInfo.Name.Length).TrimEnd('/');
LastModifiedDate = fileInfo.LastModified;
Length = fileInfo.Length;
IsDirectory = fileInfo.IsDirectory;
Properties = new();
}
}