Class VersioningFile

A versioning file

Inheritance
System.Object
VersioningFile
Implements
Inherited Members
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class VersioningFile : UnifiedFile, IVersioningFile

Properties

Changed

Last changed timestamp.

Declaration
public override DateTime Changed { get; }
Property Value
Type Description
System.DateTime
Overrides

CheckedOutBy

This file type is versioned and supports CheckedOutBy property. Uses the underlying FileSystem to query for username. VersioningFileHandler which is used by composition in this class.

Declaration
public string CheckedOutBy { get; }
Property Value
Type Description
System.String

Created

time of creation.

Declaration
public override DateTime Created { get; }
Property Value
Type Description
System.DateTime
Overrides

Guid

Gets the unique identifier for this file.

Declaration
public Guid Guid { get; }
Property Value
Type Description
System.Guid

The unique identifier for this file.

IsCheckedOut

Flag for checking if this versioned file is checked out.

Declaration
public bool IsCheckedOut { get; }
Property Value
Type Description
System.Boolean

Length

Length in bytes of the versioned file.

Declaration
public override long Length { get; }
Property Value
Type Description
System.Int64
Overrides

LocalPath

Gets the local path.

Declaration
public override string LocalPath { get; }
Property Value
Type Description
System.String

The local path.

Overrides

Parent

Returns the parent directory if the versioned file. a UnifiedDirectory returned by method returns an UnifiedDirectory equivalent derived class of VersioningDirectory.

Declaration
public override UnifiedDirectory Parent { get; }
Property Value
Type Description
UnifiedDirectory
Overrides

PermanentLinkVirtualPath

Gets the exportable path.

Declaration
public override string PermanentLinkVirtualPath { get; }
Property Value
Type Description
System.String

The exportable path as a virtual path

Overrides

Summary

Gets the Summary of Meta data for the versioning file from the underlying fs and uses a wrapper class inplementing the nesseseary interfaces as returned instance.

Declaration
public override IUnifiedSummary Summary { get; }
Property Value
Type Description
IUnifiedSummary
Overrides

Methods

CheckIn(String)

Checks in the versioned file with the comments provided.

Declaration
public void CheckIn(string comments)
Parameters
Type Name Description
System.String comments
Remarks

To checkin user must have Create or Edit access

CheckOut()

Checks out the versioned file.

Declaration
public void CheckOut()
Remarks

To checkout user must have Create or Edit access

CopyTo(String)

Copies the versioned file to a new virtual directory.

Declaration
public override void CopyTo(string newVirtualPath)
Parameters
Type Name Description
System.String newVirtualPath
Overrides

CopyTo(String, Guid)

Copies the versioned file to a new virtual directory.

Declaration
public override void CopyTo(string newVirtualPath, Guid id)
Parameters
Type Name Description
System.String newVirtualPath

Virtual path to copy the file to.

System.Guid id

Identity of the new file.

Overrides

Delete()

Deletes the native file.

Declaration
public override void Delete()
Overrides

GetVersion(Object)

Gets a specific version of a versioned file of null if the incorrect object identity is supplied.

Declaration
public UnifiedVersion GetVersion(object id)
Parameters
Type Name Description
System.Object id
Returns
Type Description
UnifiedVersion

GetVersions()

Gets all versions of this VersionedFile. Uses the underlying filesystem implementation to query for versions and convert into IUnifiedVersion list.

Declaration
public IList<UnifiedVersion> GetVersions()
Returns
Type Description
System.Collections.Generic.IList<UnifiedVersion>

MoveTo(String)

Moves the versioned file to another new virtual directory.

Declaration
public override void MoveTo(string newVirtualPath)
Parameters
Type Name Description
System.String newVirtualPath

The new virtual path.

Overrides

Open(FileMode, FileAccess, FileShare)

Opens a Stream to the native file and Stream access mode is dependent on the current users rights according to the ACL.

Declaration
public override Stream Open(FileMode mode, FileAccess access, FileShare share)
Parameters
Type Name Description
System.IO.FileMode mode

The file mode to use when open the file.

System.IO.FileAccess access

A FileAccess constant specifying whether to open the file with Read, Write, or ReadWrite file access.

System.IO.FileShare share

A FileShare value specifying the type of access other threads have to the file.

Returns
Type Description
System.IO.Stream

A open stream to the file.

Overrides

QueryAccess()

Gets the access level for the current user on this file.

Declaration
public override AccessLevel QueryAccess()
Returns
Type Description
AccessLevel

The access level.

Overrides

RenameInternal(String)

Renames the native file.

Declaration
protected void RenameInternal(string newVirtualPath)
Parameters
Type Name Description
System.String newVirtualPath

The new virtual path.

UndoCheckOut()

Undo the file checkout.

Declaration
public void UndoCheckOut()
Remarks

To undo a checkout user must have create or edit access

Implements

Extension Methods