namespace Universal;

public class Hierarchy
{
    public Hierarchy(string folderPath)
    {
        try
        {
            DirectoryInfo folder = new(folderPath);
            Directories = folder.GetDirectories();
            Files = folder.GetFiles();
            if (Directories is null)
                return;
            this.NextHierachy = [];
            Directories.Foreach(t => this.NextHierachy.Add(new(t.FullName)));
        }
        catch
        {
        }
    }
    public List<Hierarchy>? NextHierachy { get; set; }
    public DirectoryInfo[]? Directories { get; set; }
    public FileInfo[]? Files { get; set; }
}
