C# Class Griffin.WebServer.Files.DiskFileService

Serves files from the hard drive.
Inheritance: IFileService
Show file Open project: jgauffin/Griffin.WebServer Class Usage Examples

Public Methods

Method Description
DiskFileService ( string rootUri, string rootFilePath, bool substituteGzipFiles = false ) : System

Initializes a new instance of the CompositeFileService class.

GetDirectories ( Uri uri ) : IEnumerable

Gets a list of all sub directores

GetFile ( Griffin.WebServer.Files.FileContext context ) : bool

Get a file

GetFiles ( Uri uri ) : IEnumerable

Get all files that exists in the specified directory

IsDirectory ( Uri uri ) : bool

Gets if the specified url corresponds to a directory serving files

Private Methods

Method Description
GetDefaultFile ( ) : string
GetFullPath ( Uri uri ) : string

Method Details

DiskFileService() public method

Initializes a new instance of the CompositeFileService class.
public DiskFileService ( string rootUri, string rootFilePath, bool substituteGzipFiles = false ) : System
rootUri string Serve all files which are located under this URI
rootFilePath string Path to serve files from.
substituteGzipFiles bool When enabled, if a file is requested and a file with the same name + .gz exists, that version will be served instead (so long as the client supports this)
return System

GetDirectories() public method

Gets a list of all sub directores
public GetDirectories ( Uri uri ) : IEnumerable
uri System.Uri URI (as requested by the HTTP client) which should correspond to a directory.
return IEnumerable

GetFile() public method

Get a file
public GetFile ( Griffin.WebServer.Files.FileContext context ) : bool
context Griffin.WebServer.Files.FileContext Context used to locate and return files
return bool

GetFiles() public method

Get all files that exists in the specified directory
public GetFiles ( Uri uri ) : IEnumerable
uri System.Uri Uri
return IEnumerable

IsDirectory() public method

Gets if the specified url corresponds to a directory serving files
public IsDirectory ( Uri uri ) : bool
uri System.Uri Uri
return bool