Class VirtualPathUnifiedProvider

Base class for all unified providers

Inheritance
System.Object
VirtualPathUnifiedProvider
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public abstract class VirtualPathUnifiedProvider : VirtualPathProvider

Constructors

VirtualPathUnifiedProvider(String, NameValueCollection)

Base class for EPiServer implementation of VirtualPathProviders.

Declaration
public VirtualPathUnifiedProvider(string name, NameValueCollection configParameters)
Parameters
Type Name Description
System.String name

The name of the provider

System.Collections.Specialized.NameValueCollection configParameters

The config parameters for the provider

VirtualPathUnifiedProvider(String, NameValueCollection, IContentLoader, IContentProviderManager, IPageQuickSearch)

Base class for EPiServer implementation of VirtualPathProviders.

Declaration
public VirtualPathUnifiedProvider(string name, NameValueCollection configParameters, IContentLoader contentQueryable, IContentProviderManager pageProviderManager, IPageQuickSearch pageQuickSearch)
Parameters
Type Name Description
System.String name

The name of the provider

System.Collections.Specialized.NameValueCollection configParameters

The config parameters for the provider

IContentLoader contentQueryable

The content queryable.

IContentProviderManager pageProviderManager

The page provider manager.

IPageQuickSearch pageQuickSearch

The page quick search.

Fields

IllegalCharactersDisplayStringDefault

Declaration
public const string IllegalCharactersDisplayStringDefault = "%,&,+,COM[0-9],LPT[0-9],PRN,CLOCK$,AUX,CON,NUL,*."
Field Value
Type Description
System.String

IllegalCharactersRegexDefault

Declaration
public const string IllegalCharactersRegexDefault = "%|&|\\+|/COM[0-9]([/\\.]|$)|/LPT[0-9]([/\\.]|$)|/PRN([/\\.]|$)|/CLOCK\\$([/\\.]|$)|/AUX([/\\.]|$)|/NUL([/\\.]|$)|/CON([/\\.]|$)|/.+\\.$|\\.\\."
Field Value
Type Description
System.String

Properties

BypassAccessCheck

Flag indicating if this provider is configured as a virtual share.

Declaration
public bool BypassAccessCheck { get; protected set; }
Property Value
Type Description
System.Boolean

ConfigFileSummaryFullPath

Gets or sets the config file summary full path.

Declaration
public string ConfigFileSummaryFullPath { get; protected set; }
Property Value
Type Description
System.String

The config file summary full path.

ConfigurationParameters

Gets the configuration parameters for the provider

Declaration
public NameValueCollection ConfigurationParameters { get; }
Property Value
Type Description
System.Collections.Specialized.NameValueCollection

The configuration parameters.

ContentLoader

The IContentLoader instance the consumer should use / is using

Declaration
protected Injected<IContentLoader> ContentLoader { get; set; }
Property Value
Type Description
Injected<IContentLoader>

ContentProviderManager

Gets or sets the page provider manager.

Declaration
protected Injected<IContentProviderManager> ContentProviderManager { get; set; }
Property Value
Type Description
Injected<IContentProviderManager>

IllegalCharactersDisplayString

Gets the characters that are illegal in a file or directory name. The value are used to inform users which characters that are not allowed in file or directory names. The value should be a readable string, e.g. '%', '+'

Declaration
public string IllegalCharactersDisplayString { get; protected set; }
Property Value
Type Description
System.String

The illegal characters readable string.

IllegalCharactersRegex

Gets the characters that are illegal in a file or directory name. The value should be a regular expression, e.g. "%|+"

Declaration
public string IllegalCharactersRegex { get; protected set; }
Property Value
Type Description
System.String

The illegal characters regular expression pattern.

IsAccessControlListSupported

Gets or sets a value indicating whether this instance is access control list supported.

Declaration
public bool IsAccessControlListSupported { get; protected set; }
Property Value
Type Description
System.Boolean

true if this instance is access control list supported; otherwise, false.

PageQuickSearch

Gets or sets the page quick searcher

Declaration
protected Injected<IPageQuickSearch> PageQuickSearch { get; set; }
Property Value
Type Description
Injected<IPageQuickSearch>

ProviderName

Gets the name of the provider.

Declaration
public string ProviderName { get; }
Property Value
Type Description
System.String

The name of the provider.

ReadOnlyPageDirectory

Gets the shared read only page directory that is used for pages that does not support storing resources in page folder.

Declaration
public UnifiedDirectory ReadOnlyPageDirectory { get; }
Property Value
Type Description
UnifiedDirectory

The read only page directory.

SecurityDescriptor

Gets or sets the security descriptor.

Declaration
public ISecurityDescriptor SecurityDescriptor { get; protected set; }
Property Value
Type Description
ISecurityDescriptor

The security descriptor.

ShowInFileManager

Flag indicating if this provider is to be shown in FileManager UI.

Declaration
public bool ShowInFileManager { get; protected set; }
Property Value
Type Description
System.Boolean

VirtualPathRoot

Gets the virtual path root. Only paths staring with this are handled by this provider.

Declaration
public string VirtualPathRoot { get; protected set; }
Property Value
Type Description
System.String

The virtual path root, always ending with a /.

Methods

HasAccessToVirtualPath(String)

Checks if the current user Principal has access to the supplied virtualPath.

Declaration
public static bool HasAccessToVirtualPath(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

virtualPath to query for access.

Returns
Type Description
System.Boolean

Has access to path flag.

IsReadOnlyPageDirectory(UnifiedDirectory)

Determines whether specified directory is a readonly page directory

Declaration
public static bool IsReadOnlyPageDirectory(UnifiedDirectory directory)
Parameters
Type Name Description
UnifiedDirectory directory

The directory.

Returns
Type Description
System.Boolean

true if the specified directory is a readonly page directory; otherwise, false.

IsVirtualPath(String)

Determines whether virtualPath is a virtual path handled by this provider.

Declaration
public bool IsVirtualPath(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

Returns
Type Description
System.Boolean

true if the specified virtual path is handled by this provider; otherwise, false.

MapPathInternal(DirectoryInfo, String)

Maps a virtual path to it's corresponding physical path, given a physical path base.

Declaration
protected string MapPathInternal(DirectoryInfo _physicalPathBase, string virtualPath)
Parameters
Type Name Description
System.IO.DirectoryInfo _physicalPathBase

The physical path base.

System.String virtualPath

The virtual path.

Returns
Type Description
System.String

A physical path

QueryAccess(String, IPrincipal)

A chance for the provider to manage user access permissions to its resources

Declaration
public virtual AccessLevel QueryAccess(string virtualPath, IPrincipal user)
Parameters
Type Name Description
System.String virtualPath
System.Security.Principal.IPrincipal user
Returns
Type Description
AccessLevel

QueryDistinctAccess(String, IPrincipal, AccessLevel)

Queries the distinct access.

Declaration
public bool QueryDistinctAccess(string virtualPath, IPrincipal user, AccessLevel accessLevel)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

System.Security.Principal.IPrincipal user

The user.

AccessLevel accessLevel

The access level.

Returns
Type Description
System.Boolean

SafeBooleanParse(String)

Parses the configuration property [key] as a boolean. Uses safe parsing, i.e. a fault value which cannot be parsed as a bool returns false.

Declaration
protected bool SafeBooleanParse(string key)
Parameters
Type Name Description
System.String key
Returns
Type Description
System.Boolean

SafeIntegerParse(String, Int32)

Parses the configuration property [key] as an integer. Uses safe parsing, i.e. a fault value which cannot be parsed as an int returns defaultValue.

Declaration
protected int SafeIntegerParse(string key, int defaultValue)
Parameters
Type Name Description
System.String key
System.Int32 defaultValue
Returns
Type Description
System.Int32

TryGetHandledAbsolutePath(String, out String)

Tries to get the absolute path.

Declaration
protected bool TryGetHandledAbsolutePath(string virtualPath, out string handledPath)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

System.String handledPath

The resulting absolute path.

Returns
Type Description
System.Boolean

True if the virtual path is handled by the current provider.

TrySplitVirtualPath(String, out List<String>)

Split the virtual path, removing empty components and starting with the first directory under the root of the provider, i.e. make the list provider-root-relative.

Declaration
public bool TrySplitVirtualPath(string virtualPath, out List<string> directories)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

System.Collections.Generic.List<System.String> directories

The directories.

Returns
Type Description
System.Boolean

false if the virtualPath was not for this provider, true if a list of directories is returned

TryToAbsolute(String, out String)

Tries to canonicalize the path to absolute form, i.e. start with a "/".

Declaration
public bool TryToAbsolute(string virtualPath, out string absolutePath)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

System.String absolutePath

The absolute path, or null

Returns
Type Description
System.Boolean

true if an absolute path to this provider was returned, false otherwise

TryToRelative(String, out String)

Gets the provider-relative virtual path.

Declaration
public bool TryToRelative(string virtualPath, out string relativePath)
Parameters
Type Name Description
System.String virtualPath

The virtual path.

System.String relativePath

A path that is relative to the provider root, never starting with "/", or null

Returns
Type Description
System.Boolean

false if the virtualPath was not for this provider, true if a provider-relative path was returned.

ValidateAndSetupConfigParams()

Validates the required parameters passed to provider. Required are: virtualName. Also initializes the optionan attributes: virtualShare, pageDirectory, showInFileManager, maxVersions, configFileSummary.

Declaration
protected void ValidateAndSetupConfigParams()

VerifyAccessToVirtualPath(String)

Verifies the access for the current user Principal to the supplied virtualPath. Throws an AccessDeniedException if access is denied. Internally calls method HasAccessToVirtualPath.

Declaration
public static void VerifyAccessToVirtualPath(string virtualPath)
Parameters
Type Name Description
System.String virtualPath

Extension Methods