Class IOHelperExtensions
Inheritance
object
Namespace: Umbraco.Extensions
Assembly: Umbraco.Core.dll
Syntax
public static class IOHelperExtensions
Methods
View SourceCreateRandomFileName(IIOHelper)
Declaration
public static string CreateRandomFileName(this IIOHelper ioHelper)
Parameters
| Type | Name | Description |
|---|---|---|
| IIOHelper | ioHelper |
Returns
| Type | Description |
|---|---|
| string |
ResolveRelativeOrVirtualUrl(IIOHelper, string?)
Will resolve a virtual path URL to an absolute path, else if it is not a virtual path (i.e. starts with ~/) then it will just return the path as-is (relative).
Declaration
public static string? ResolveRelativeOrVirtualUrl(this IIOHelper ioHelper, string? path)
Parameters
| Type | Name | Description |
|---|---|---|
| IIOHelper | ioHelper | |
| string | path |
Returns
| Type | Description |
|---|---|
| string |
TryCreateDirectory(IIOHelper, string)
Tries to create a directory.
Declaration
public static bool TryCreateDirectory(this IIOHelper ioHelper, string dir)
Parameters
| Type | Name | Description |
|---|---|---|
| IIOHelper | ioHelper | The IOHelper. |
| string | dir | the directory path. |
Returns
| Type | Description |
|---|---|
| bool | true if the directory was created, false otherwise. |