Table of Contents

Interface IStoragePathRegistry

Namespace
CMS.IO
Assembly
CMS.IO.dll

Provides methods for registering and querying file system paths used by the application.

public interface IStoragePathRegistry
Extension Methods

Remarks

Modules should register their file system paths during initialization with the appropriate PathType.

Consumers (such as storage initialization modules) can query the registry to determine which paths need to be mapped to which storage type in cloud or web farm deployments.

The registry stores path intent, not environment-specific mapping decisions. Environment-specific behavior (for example cloud vs local development) should be implemented by mapping modules that consume this API.

Methods

GetRegistrations()

Gets all registered paths with their metadata.

IEnumerable<PathRegistration> GetRegistrations()

Returns

IEnumerable<PathRegistration>

Collection of all path registrations.

Remarks

The returned collection does not guarantee ordering. If consumers require stable ordering, they should explicitly sort the results.

GetRegistrations(PathType)

Gets all paths registered with the specified path type.

IEnumerable<PathRegistration> GetRegistrations(PathType pathType)

Parameters

pathType PathType

The path type to query.

Returns

IEnumerable<PathRegistration>

Collection of path registrations with the specified type.

RegisterPath(string, PathType)

Registers a file system path with the specified type.

void RegisterPath(string path, PathType pathType)

Parameters

path string

The path to register (e.g., "~/assets/BizFormFiles").

pathType PathType

The type of the path.

Remarks

The pathType parameter captures the storage intent of the path (for example shared persistent data or shared temporary data). It should describe the nature of the data, not a concrete provider implementation.

Supported path formats include app-root-relative paths (for example ~/assets/media), non-rooted relative paths (for example assets/media), and fully qualified absolute paths.

On Windows, root-relative paths without a drive or UNC root (for example /path or \path) are not supported and cause an System.ArgumentException.

Exceptions

ArgumentException

Thrown when path is null, empty, whitespace, or is a Windows root-relative path without a drive or UNC root.

InvalidOperationException

Thrown when path is already registered.