November Happy Hour will be moved to Thursday December 5th.

Class PathMatching

Support for matching file and directory paths against predefined lists.

Inheritance
System.Object
PathMatching
Implements
System.Collections.Generic.IEnumerable<System.String>
System.Collections.IEnumerable
Namespace: EPiServer.Web.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public class PathMatching : Object, IEnumerable<string>, IEnumerable

Constructors

PathMatching()

Declaration
public PathMatching()

Methods

AddPath(String)

Adds the path to the set of paths to match against.

Declaration
public void AddPath(string path)
Parameters
Type Name Description
System.String path

The path to add.

Remarks

If the path starts with a tilde ('~') it will be expanded to contain the actual application root.

The path is interpreted as a directory if it ends with a '/'. Adding a path such as "/abc/" will match against anything that starts with "/abc/", such as "/abc/def/ghi.html".

If the path does not end with a '/' it is interpreted as a file. Adding a file will only match against the exact path added.

Clear()

Clears this instance.

Declaration
public void Clear()
Remarks

Will remove all path entries that has been added by calling AddPath.

GetEnumerator()

Returns an enumerator that iterates through the collection of URL:s used for path matching.

Declaration
public IEnumerator<string> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.String>

A System.Collections.Generic.IEnumerator<> that can be used to iterate through the collection.

IsMatch(String)

Determines whether the specified path matches a previously added path.

Declaration
public bool IsMatch(string path)
Parameters
Type Name Description
System.String path

The path.

Returns
Type Description
System.Boolean

true if the specified path is match; otherwise, false.

Remarks

Will check against all added paths, both directories and files. The matching is case-insensitive.

Implements

System.Collections.Generic.IEnumerable<>
System.Collections.IEnumerable

Extension Methods