C# Class Nancy.EmbeddedContent.Conventions.EmbeddedStaticContentConventionBuilder

Allows the use of embedded resources for static content in Nancy
Show file Open project: jugglingnutcase/Nancy.EmbeddedContent Class Usage Examples

Public Methods

Method Description
AddDirectory ( string requestedPath, Assembly assembly, string contentPath = null ) : Func

Adds a directory-based convention for embedded static convention

Private Methods

Method Description
BuildContentDelegate ( NancyContext context, string requestedPath, string contentPath, Assembly assembly, string allowedExtensions ) : Func>
EmbeddedStaticContentConventionBuilder ( ) : System
GetContentPath ( string requestedPath, string contentPath ) : string
GetEncodedPath ( string path ) : string
GetPathWithoutFilename ( string fileName, string path ) : string
GetSafeRequestPath ( string requestPath, string requestedPath, string contentPath ) : string
IsWithinContentFolder ( string contentRootPath, string fileName ) : bool

Returns whether the given filename is contained within the content folder

Method Details

AddDirectory() public static method

Adds a directory-based convention for embedded static convention
public static AddDirectory ( string requestedPath, Assembly assembly, string contentPath = null ) : Func
requestedPath string The path that should be matched with the request
assembly System.Reflection.Assembly The assembly that contains the embedded static content
contentPath string The path to where the content is stored in your application, relative to the root. If this is then it will be the same as .
return Func