Class File
Represents an abstract file which provides basic functionality for a File with an Alias and Name
Inheritance
System.Object
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public abstract class File : Entity, IRememberBeingDirty, ICanBeDirty, IFile, IAggregateRoot, IDeletableEntity, IEntity, IDeepCloneable
Constructors
File(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
Alias
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 |
|
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
DeepClone()
Declaration
public override object DeepClone()
Returns
Type |
Description |
System.Object |
|
DeepCloneNameAndAlias(File)
Declaration
protected virtual void DeepCloneNameAndAlias(File clone)
Parameters
Type |
Name |
Description |
File |
clone |
|
IsValid()
Declaration
[Obsolete("This is no longer used and will be removed from the codebase in future versions")]
public virtual bool IsValid()
Returns
Type |
Description |
System.Boolean |
|
ResetOriginalPath()
Called to re-set the OriginalPath to the Path
Declaration
public void ResetOriginalPath()