create new file system (based on Orchard)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user