C# Class org.GraphDefined.Vanaheimr.Hermod.HTTP.HTTPStandardHandlers

Standard handlers for HTTP servers.
Mostrar archivo Open project: Vanaheimr/Hermod

Public Methods

Method Description
RegisterEventStreamHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String EventSource ) : void

Register a EventStream handler.

RegisterFilesystemFile ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String>.Func ResourceFilenameBuilder, String DefaultFile = null, HTTPContentType ResponseContentType = null, String CacheControl = "no-cache" ) : void

Returns a resource from the given file system location.

RegisterFilesystemFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String>.Func ResourcePath, String DefaultFilename = "index.html" ) : void

Returns resources from the given file system location.

RegisterMovedTemporarilyHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String URITarget ) : void

Register a MovedTemporarily handler.

RegisterRAWRequestHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, HTTPMethod HTTPMethod = null ) : void

Return the RAW request header.

RegisterResourcesFile ( this HTTPServer, HTTPHostname Hostname, String URITemplate, Assembly ResourceAssembly, String ResourceFilename, HTTPContentType ResponseContentType = null, String CacheControl = "no-cache" ) : void

Returns internal resources embedded within the given assembly.

RegisterResourcesFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String ResourcePath, Assembly ResourceAssembly = null, String DefaultFilename = "index.html", String HTTPRealm = null, String HTTPLogin = null, String HTTPPassword = null ) : void

Returns internal resources embedded within the given assembly.

RegisterWatchedFileSystemFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String FileSystemLocation, String HTTPSSE_EventIdentification, String HTTPSSE_URITemplate, String DefaultFilename = "index.html" ) : void

Returns resources from the given file system location.

RegisterWatchedFileSystemFolder ( this HTTPServer, String URITemplate, String FileSystemLocation, String HTTPSSE_EventIdentification, String HTTPSSE_URITemplate, String DefaultFilename = "index.html" ) : void

Returns resources from the given file system location.

Private Methods

Method Description
FileWasChanged ( HTTPServer source, String HTTPSSE_EventIdentification, String ChangeType, String FileName ) : void
FileWasRenamed ( object source, RenamedEventArgs e ) : void
FileWatcherError ( object sender, ErrorEventArgs e ) : void

Method Details

RegisterEventStreamHandler() public static method

Register a EventStream handler.
public static RegisterEventStreamHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String EventSource ) : void
HTTPServer this
Hostname HTTPHostname
URITemplate String
EventSource String
return void

RegisterFilesystemFile() public static method

Returns a resource from the given file system location.
public static RegisterFilesystemFile ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String>.Func ResourceFilenameBuilder, String DefaultFile = null, HTTPContentType ResponseContentType = null, String CacheControl = "no-cache" ) : void
HTTPServer this A HTTP server.
Hostname HTTPHostname The HTTP hostname.
URITemplate String An URI template.
ResourceFilenameBuilder String>.Func The path to the file within the assembly.
DefaultFile String If an error occures, return this file.
ResponseContentType HTTPContentType Set the HTTP MIME content-type of the file. If null try to autodetect the content type based on the filename extention.
CacheControl String Set the HTTP cache control response header.
return void

RegisterFilesystemFolder() public static method

Returns resources from the given file system location.
public static RegisterFilesystemFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String>.Func ResourcePath, String DefaultFilename = "index.html" ) : void
HTTPServer this A HTTP server.
Hostname HTTPHostname The HTTP hostname.
URITemplate String An URI template.
ResourcePath String>.Func The path to the file within the assembly.
DefaultFilename String The default file to load.
return void

RegisterMovedTemporarilyHandler() public static method

Register a MovedTemporarily handler.
public static RegisterMovedTemporarilyHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String URITarget ) : void
HTTPServer this
Hostname HTTPHostname
URITemplate String
URITarget String
return void

RegisterRAWRequestHandler() public static method

Return the RAW request header.
public static RegisterRAWRequestHandler ( this HTTPServer, HTTPHostname Hostname, String URITemplate, HTTPMethod HTTPMethod = null ) : void
HTTPServer this
Hostname HTTPHostname
URITemplate String
HTTPMethod HTTPMethod
return void

RegisterResourcesFile() public static method

Returns internal resources embedded within the given assembly.
public static RegisterResourcesFile ( this HTTPServer, HTTPHostname Hostname, String URITemplate, Assembly ResourceAssembly, String ResourceFilename, HTTPContentType ResponseContentType = null, String CacheControl = "no-cache" ) : void
HTTPServer this A HTTP server.
Hostname HTTPHostname The HTTP hostname.
URITemplate String An URI template.
ResourceAssembly System.Reflection.Assembly The assembly where the resources are located.
ResourceFilename String The path to the file within the assembly.
ResponseContentType HTTPContentType Set the HTTP MIME content-type of the file. If null try to autodetect the content type based on the filename extention.
CacheControl String Set the HTTP cache control response header.
return void

RegisterResourcesFolder() public static method

Returns internal resources embedded within the given assembly.
public static RegisterResourcesFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String ResourcePath, Assembly ResourceAssembly = null, String DefaultFilename = "index.html", String HTTPRealm = null, String HTTPLogin = null, String HTTPPassword = null ) : void
HTTPServer this A HTTP server.
Hostname HTTPHostname The HTTP hostname.
URITemplate String An URI template.
ResourcePath String The path to the file within the assembly.
ResourceAssembly System.Reflection.Assembly Optionally the assembly where the resources are located (default: the calling assembly).
DefaultFilename String The default file to load.
HTTPRealm String An optional realm for HTTP basic authentication.
HTTPLogin String An optional login for HTTP basic authentication.
HTTPPassword String An optional password for HTTP basic authentication.
return void

RegisterWatchedFileSystemFolder() public static method

Returns resources from the given file system location.
public static RegisterWatchedFileSystemFolder ( this HTTPServer, HTTPHostname Hostname, String URITemplate, String FileSystemLocation, String HTTPSSE_EventIdentification, String HTTPSSE_URITemplate, String DefaultFilename = "index.html" ) : void
HTTPServer this A HTTP server.
Hostname HTTPHostname
URITemplate String An URI template.
FileSystemLocation String
HTTPSSE_EventIdentification String
HTTPSSE_URITemplate String
DefaultFilename String The default file to load.
return void

RegisterWatchedFileSystemFolder() public static method

Returns resources from the given file system location.
public static RegisterWatchedFileSystemFolder ( this HTTPServer, String URITemplate, String FileSystemLocation, String HTTPSSE_EventIdentification, String HTTPSSE_URITemplate, String DefaultFilename = "index.html" ) : void
HTTPServer this A HTTP server.
URITemplate String An URI template.
FileSystemLocation String
HTTPSSE_EventIdentification String
HTTPSSE_URITemplate String
DefaultFilename String The default file to load.
return void