Interface IMediaPathScheme
Represents a media file path scheme.
Namespace: Umbraco.Cms.Core.IO
Assembly: Umbraco.Core.dll
Syntax
public interface IMediaPathScheme
Properties
View SourceSupportsGuid7
Gets a value indicating whether GUID version 7 is supported.
Declaration
bool SupportsGuid7 { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceGetDeleteDirectory(MediaFileManager, string)
Gets the directory that can be deleted when the file is deleted.
Declaration
string? GetDeleteDirectory(MediaFileManager fileSystem, string filepath)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaFileManager | fileSystem | The media filesystem. |
| string | filepath | The filesystem-relative path of the file. |
Returns
| Type | Description |
|---|---|
| string | The filesystem-relative path of the directory. |
Remarks
The directory, and anything below it, will be deleted.
Can return null (or empty) when no directory should be deleted.
GetFilePath(MediaFileManager, Guid, Guid, string)
Gets a media file path.
Declaration
string GetFilePath(MediaFileManager fileManager, Guid itemGuid, Guid propertyGuid, string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaFileManager | fileManager | The media filesystem. |
| Guid | itemGuid | The (content, media) item unique identifier. |
| Guid | propertyGuid | The property type unique identifier. |
| string | filename | The file name. |
Returns
| Type | Description |
|---|---|
| string | The filesystem-relative complete file path. |
IsFilePathOwnedBy(MediaFileManager, string, Guid, Guid)
Determines whether a media file path is one this scheme could have produced for the given content and property type.
Declaration
bool IsFilePathOwnedBy(MediaFileManager fileManager, string filepath, Guid itemGuid, Guid propertyGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| MediaFileManager | fileManager | The media filesystem. |
| string | filepath | The filesystem-relative path of the file to check. |
| Guid | itemGuid | The (content, media) item unique identifier the file is expected to belong to. |
| Guid | propertyGuid | The property type unique identifier the file is expected to belong to. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Used before deleting or renaming a file referenced by a stored property value, to confirm the path belongs to the item being processed rather than one supplied by a client to target another item's file.