Table of Contents

Class Handler

Namespace
DirectoryToObject
Assembly
DirectoryToObject.dll

Predefined file loading handlers.

public static class Handler
Inheritance
Handler
Inherited Members

Properties

Directory

Handles directories by opening them so that the processing can continue down the entry. Use this in combination with loader modifiers to handle directories in a specific, non-default, way.

public static DirectoryLoaderBuilder Directory { get; }

Property Value

DirectoryLoaderBuilder

JsonFile

Handles all files as JSON. Combine this with the WhenExtensionIsOneOf(params string[]) method to narrow the handling to files with one or more specific extension. E.g., Handler.JsonFile.WhenExtensionIsOneOf(".json")

public static DirectoryLoaderBuilder JsonFile { get; }

Property Value

DirectoryLoaderBuilder

TextFile

Handles all files as plain text. Combine this with the WhenExtensionIsOneOf(params string[]) method to narrow the handling to files with one or more specific extension. E.g., Handler.TextFile.WhenExtensionIsOneOf(".txt", ".md")

public static DirectoryLoaderBuilder TextFile { get; }

Property Value

DirectoryLoaderBuilder

Methods

NewDirectoryLoader(Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>>)

Create a new loader that matches all directories and uses the entry processing function in the processEntry parameter.

public static DirectoryLoaderBuilder NewDirectoryLoader(Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>> processEntry)

Parameters

processEntry Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>>

The entry processing function that will be called to retrieve the directory contents.

Returns

DirectoryLoaderBuilder

A DirectoryLoaderBuilder that matches all directories and calls the provided function.

NewFileLoader(Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>>)

Create a new loader that matches all files and uses the entry processing function in the processEntry parameter.

public static DirectoryLoaderBuilder NewFileLoader(Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>> processEntry)

Parameters

processEntry Func<IFileSystemDirectory, IFileSystemEntry, string, Task<ContextResponse>>

The entry processing function that will be called to retrieve the file contents.

Returns

DirectoryLoaderBuilder

A DirectoryLoaderBuilder that matches all files and calls the provided function.