C# Class newtelligence.DasBlog.Web.Core.MovableTypeBlacklist

MovableTypeBlacklist is a class that can check if a url is on the MT-Blacklist Master Copy http://www.jayallen.org/comment_spam/blacklist.txt.
Inheritance: IBlackList
Exibir arquivo Open project: AArnott/dasblog

Public Methods

Method Description
Initialize ( string localPath ) : void
Initialize ( string localPath, Uri internetAddress ) : void

Initializes the MovableTypeBlacklist.

IsBlacklisted ( string url ) : Match

Determines if the url is blacklisted.

UpdateBlacklist ( ) : BlacklistUpdateState

Downloads the MT-Blacklist Master Copy.

The file will only get downloaded a maximum of once per day. The file is downloaded using gzip compression from the server.

Private Methods

Method Description
OpenFile ( ) : string
WriteToFile ( string contents, System.DateTime lastModified ) : void

Method Details

Initialize() public method

public Initialize ( string localPath ) : void
localPath string
return void

Initialize() public method

Initializes the MovableTypeBlacklist.
public Initialize ( string localPath, Uri internetAddress ) : void
localPath string The absolute path to the local blacklist.txt file
internetAddress System.Uri The for the internet address of the MT-Blacklist Master Copy.
return void

IsBlacklisted() public method

Determines if the url is blacklisted.
public IsBlacklisted ( string url ) : Match
url string The url to check.
return System.Text.RegularExpressions.Match

UpdateBlacklist() public method

Downloads the MT-Blacklist Master Copy.
The file will only get downloaded a maximum of once per day. The file is downloaded using gzip compression from the server.
public UpdateBlacklist ( ) : BlacklistUpdateState
return BlacklistUpdateState