Class File
Represents an abstract file which provides basic functionality for a File with an Alias and Name
Namespace: Umbraco.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public abstract class File : EntityBase, IRememberBeingDirty, ICanBeDirty, IFile, IEntity, IDeepCloneable
Constructors
View SourceFile(String, Func<File, String>)
Declaration
protected File(string path, Func<File, string> getFileContent = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
System.Func<File, System.String> | getFileContent |
Properties
View SourceAlias
Gets or sets the Alias of the File, which is the name without the extension
Declaration
[DataMember]
public virtual string Alias { get; }
Property Value
Type | Description |
---|---|
System.String |
Content
Gets or sets the Content of a File
Declaration
[DataMember]
public virtual string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Marked as DoNotClone, because it should be lazy-reloaded from disk.
Name
Gets or sets the Name of the File including extension
Declaration
[DataMember]
public virtual string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
OriginalPath
Gets the original path of the file
Declaration
public string OriginalPath { get; }
Property Value
Type | Description |
---|---|
System.String |
Path
Gets or sets the Path to the File from the root of the file's associated IFileSystem
Declaration
[DataMember]
public virtual string Path { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 SourceDeepCloneNameAndAlias(File)
Declaration
protected virtual void DeepCloneNameAndAlias(File clone)
Parameters
Type | Name | Description |
---|---|---|
File | clone |
PerformDeepClone(Object)
Declaration
protected override void PerformDeepClone(object clone)
Parameters
Type | Name | Description |
---|---|---|
System.Object | clone |
ResetOriginalPath()
Called to re-set the OriginalPath to the Path
Declaration
public void ResetOriginalPath()