Skip to content

BH.oM.Adapters.File.FSDirectory

A FileSystem-hosted Directory. It can include the content of the Directory.

Class structure

Implemented interfaces and base types

The FSDirectory is inheriting from the following base type(s) and implements the following interfaces:

Properties

Defining properties

The following properties are defined on the class

Name Type Description Quantity
ParentDirectory FSDirectory Full path of parent Directory. You can also specify a string path. -
Name string Name of the directory. -
Exists Nullable<bool> Gets a value indicating whether a file exists. -
IsReadOnly Nullable<bool> Whether the folder is read only. -
Size int Size of the folder in Bytes. This is never automatically computed. -
Attributes FileAttributes Attributes indicating if ReadOnly, Hidden, System File, etc. -
CreationTime DateTime - -
CreationTimeUtc DateTime - -
LastWriteTime DateTime - -
ModifiedTimeUtc DateTime - -
Owner string User owning the Directory, if any, or the user who created the Directory. -
Content List<object> The content of the Directory. This is populated only once Pulled. -

Inherited properties

The following properties are inherited from the base class of the object

Name Type Description Quantity
BHoM_Guid Guid - -
Fragments FragmentSet - -
Tags HashSet<string> - -
CustomData Dictionary<string, object> - -

Derived properties

The following properties are defined as extension methods in one of the BHoM_Engines

Name Type Description Quantity Engine
IsAcyclic bool Test whether the file hierarchy is acyclic, i.e. has no loops in it. - File_Engine
NestingDepth int Get the nesting depth of the input File or Directory, which is the total number of parent folders. - File_Engine

Code and Schema

C# implementation

C#
public class FSDirectory : BH.oM.Base.BHoMObject,
BH.oM.Base.IBHoMObject,
BH.oM.Base.IObject,
BH.oM.Adapters.File.IFSContainer,
BH.oM.Adapters.File.IFSInfo,
BH.oM.Adapters.File.IContainableResource,
BH.oM.Adapters.File.IResource,
BH.oM.Adapters.File.IDirectory,
BH.oM.Adapters.File.ISizeableResource

Assembly: File_oM.dll

The C# class definition is available on github:

All history and changes of the class can be found by inspection the history.

JSON Schema implementation

The object is defined as a JSON schema. You can validate a JSON instance against this schema by reference. To do this, use the schema reference below in a validator like this one.

JSON Schema
{
 "$ref" : "https://raw.githubusercontent.com/BHoM/BHoM_JSONSchema/develop/File_oM/FSDirectory.json"
}

The JSON Schema is available on github here: