Sisk

Class

HttpFileServerHandler

Namespace
Sisk.Core.Http.FileSystem
Assembly
Sisk.Core.dll

Provides HTTP file-serving capabilities for a specified root directory, including optional directory listing and file conversion.

C#
public class HttpFileServerHandler

Inheritance #

object ← HttpFileServerHandler

Inherited Members #

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors #

NameDescription
HttpFileServerHandler(string)Initializes a new instance of the HttpFileServerHandler class with the specified root directory.
HttpFileServerHandler()Initializes a new instance of the HttpFileServerHandler class using the current working directory as the root.

Properties #

NameDescription
AllowDirectoryListingGets or sets a value indicating whether directory listing is enabled when an index file is not present.
AllowIndexGets or sets a value indicating whether an index.html file is automatically served when a directory is requested.
FileConvertersGets the list of converters used to transform files before they are sent to the client.
RootDirectoryPathGets or sets the absolute or relative path to the root directory from which files are served.
RoutePrefixGets or sets the optional route prefix that must be matched for requests to be handled by this instance. Matched prefix will be trimmed from the request path when resolving files.

Methods #

NameDescription
ContainsReparsePointBetweenRootAndPath(string)Checks whether any segment between the configured root and the requested path is a symlink/reparse point.
HandleRequest(HttpRequest)Processes the incoming HTTP request and returns the appropriate file or directory response.
HasReparsePoint(string)Determines whether a file-system path is a symlink/reparse point.
IsEntryAllowedToListing(string)Determines whether the specified file-system entry is allowed to be listed.
IsPathContainedInRoot(string)Determines whether the specified path resolves under the configured root directory.
IsRequestAllowed(HttpRequest)Determines whether the incoming HTTP request is allowed to proceed.
ResolvePath(string)Resolves the specified virtual path to a physical file or directory within the root directory.
ServeDirectoryListing(DirectoryInfo, HttpRequest)Generates an HTML directory listing for the specified directory and returns it as an HTTP response.
ServeFile(FileInfo, HttpRequest)Serves the specified file as an HTTP response, applying the first compatible converter if available.

Type to search the documentation and the API reference.