View Source
Class File
Represents an abstract file which provides basic functionality for a File with an Alias and Name
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public abstract class File : EntityBase, IFile, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View Source
File(String, Func<File, String>)
Declaration
protected File(string path, Func<File, string> getFileContent = null)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Func<File, System.String> |
getFileContent |
|
Properties
View Source
Alias
Gets or sets the Alias of the File, which is the name without the extension
Declaration
public virtual string Alias { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Content
Gets or sets the Content of a File
Declaration
public virtual string Content { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
GetFileContent
Declaration
public Func<File, string> GetFileContent { get; set; }
Property Value
Type |
Description |
Func<File, System.String> |
|
View Source
Name
Gets or sets the Name of the File including extension
Declaration
public virtual string Name { get; }
Property Value
Type |
Description |
System.String |
|
View Source
OriginalPath
Gets the original path of the file
Declaration
public string OriginalPath { get; }
Property Value
Type |
Description |
System.String |
|
View Source
Path
Gets or sets the Path to the File from the root of the file's associated IFileSystem
Declaration
public virtual string Path { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
VirtualPath
Gets or sets the file's virtual path (i.e. the file path relative to the root of the website)
Declaration
public string VirtualPath { get; set; }
Property Value
Type |
Description |
System.String |
|
Methods
View Source
DeepCloneNameAndAlias(File)
Declaration
protected virtual void DeepCloneNameAndAlias(File clone)
Parameters
Type |
Name |
Description |
File |
clone |
|
View Source
Declaration
protected override void PerformDeepClone(object clone)
Parameters
Type |
Name |
Description |
System.Object |
clone |
|
View Source
ResetOriginalPath()
Called to re-set the OriginalPath to the Path
Declaration
public void ResetOriginalPath()