Class VersioningDirectory
Implemetation of UnifiedDirectory for VersioningFiles. The directories does not support versioning, only file versions are supported in this implementation.
Inherited Members
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public class VersioningDirectory : UnifiedDirectory, IPageDirectory, IContentDirectory
Constructors
VersioningDirectory(VirtualPathUnifiedProvider, String, VersioningDirectoryHandler, VersioningFileSystem, String, Boolean)
Initializes a new instance of the VersioningDirectory class.
Declaration
public VersioningDirectory(VirtualPathUnifiedProvider provider, string virtualPath, VersioningDirectoryHandler dvdh, VersioningFileSystem fs, string customSummaryFullPath, bool bypassAccessCheck)
Parameters
Type | Name | Description |
---|---|---|
VirtualPathUnifiedProvider | provider | The provider this directory is served by |
System.String | virtualPath | Virtual path below base Path. |
VersioningDirectoryHandler | dvdh | Directory handler to undelying versioning file system. |
VersioningFileSystem | fs | Underlying VerioningFileSystem instance. |
System.String | customSummaryFullPath | Full path to custom summary file. Can be null. |
System.Boolean | bypassAccessCheck | Directory is a virtual share flag. |
VersioningDirectory(VirtualPathUnifiedProvider, String, VersioningDirectoryHandler, VersioningFileSystem, String, Boolean, SearchIndexConfig)
Initializes a new instance of the VersioningDirectory class.
Declaration
public VersioningDirectory(VirtualPathUnifiedProvider provider, string virtualPath, VersioningDirectoryHandler dvdh, VersioningFileSystem fs, string customSummaryFullPath, bool bypassAccessCheck, SearchIndexConfig searchIndexConfig)
Parameters
Type | Name | Description |
---|---|---|
VirtualPathUnifiedProvider | provider | The provider. |
System.String | virtualPath | The virtual path. |
VersioningDirectoryHandler | dvdh | The DVDH. |
VersioningFileSystem | fs | The fs. |
System.String | customSummaryFullPath | The custom summary full path. |
System.Boolean | bypassAccessCheck | if set to |
SearchIndexConfig | searchIndexConfig | The search index config. |
Properties
Children
Gets all subdirectories and files in directory. This under the hood is the same as calling properties Directories + Files and adding the two results together.
Declaration
public override IEnumerable Children { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
Overrides
Directories
Gets all subdirectories in an IEnumerable collection of VirtualDirectory derived classes.
Declaration
public override IEnumerable Directories { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
Overrides
DirectoryHandler
The underlying VersioningDirectoryHandler handler. This property may be unsafe since it provides an option to work directly on the underlying file system and not using the VPP API. This may cause security lacks and mixture of systems to occur. ///
Declaration
public VersioningDirectoryHandler DirectoryHandler { get; }
Property Value
Type | Description |
---|---|
VersioningDirectoryHandler |
Files
Gets all files in an IEnumerable collection of VirtualDirectory derived classes.
Declaration
public override IEnumerable Files { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerable |
Overrides
Guid
Gets the unique identifier for this directory.
Declaration
public Guid Guid { get; }
Property Value
Type | Description |
---|---|
System.Guid | The unique identifier for this directory. |
IsFirstLevel
TODO !!! Rewrite, too slow determination !!!!
Declaration
public override bool IsFirstLevel { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsVersioningSupported
Supports versioning.
Declaration
public override bool IsVersioningSupported { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
Parent
Gets the parent directory. Internally uses the VPP API to try to locate a VirtualDirectory for the parent of the current directory. If VPP returns a null directory internally this is considered to be a request above virtual root. Return object form VPP is also casted into a VersioningDirectory.
Declaration
public override UnifiedDirectory Parent { get; }
Property Value
Type | Description |
---|---|
UnifiedDirectory |
Overrides
Methods
CopyTo(String)
Copies this directory to another virtual path.
Declaration
public override void CopyTo(string newVirtualPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | newVirtualPath |
Overrides
CreateFile(String)
Under the current versioning directory creates a new file.
Declaration
public override UnifiedFile CreateFile(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
UnifiedFile |
Overrides
CreateFile(String, Guid)
Creates a new file under the current versioning directory.
Declaration
public override UnifiedFile CreateFile(string name, Guid id)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The filename. |
System.Guid | id | The id of the created file. |
Returns
Type | Description |
---|---|
UnifiedFile | A UnifiedFile. |
Overrides
CreateSubdirectory(String, IContent)
Creates the subdirectory. The access control should be matched against passed page.
Declaration
public UnifiedDirectory CreateSubdirectory(string path, IContent accessValidatingContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the directory to create |
IContent | accessValidatingContent | The page to match access against |
Returns
Type | Description |
---|---|
UnifiedDirectory | A handle to the created directory |
CreateSubdirectory(String, PageData)
Creates a new subdirectory under current directory. The access control should be matched against passed acl.
Declaration
public UnifiedDirectory CreateSubdirectory(string path, PageData accessValidatingPage)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the directory to create |
PageData | accessValidatingPage | The page to match access against |
Returns
Type | Description |
---|---|
UnifiedDirectory | A handle to the created directory |
Remarks
The user needs either Create or Edit access on the page to be allowed to create a directory
CreateSubdirectoryInternal(String)
Creates a subdirectory.
Declaration
protected override UnifiedDirectory CreateSubdirectoryInternal(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | the name of the subdirectory to create |
Returns
Type | Description |
---|---|
UnifiedDirectory |
Overrides
Remarks
This method does not perform any access checks. That is done in method CreateSubdirectory(String, IContent).
Delete()
Deletes the versioning directory.
Declaration
public override void Delete()
Overrides
GetDirectories()
Gets the sub directories under this versioning directory.
Declaration
public override UnifiedDirectory[] GetDirectories()
Returns
Type | Description |
---|---|
UnifiedDirectory[] |
Overrides
GetFiles()
Gets all files in directory. Internally calles property Files and iterates through the result and by this creates a more typed result.
Declaration
public override UnifiedFile[] GetFiles()
Returns
Type | Description |
---|---|
UnifiedFile[] |
Overrides
MoveTo(String)
Renames the current versioned directory. Moves this directory into a virtual sub directory.
Declaration
public override void MoveTo(string newVirtualPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | newVirtualPath | The new virtual path. |
Overrides
RenameInternal(UnifiedVirtualPathEventArgs)
Renames the current versioned directory.
Declaration
protected void RenameInternal(UnifiedVirtualPathEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
UnifiedVirtualPathEventArgs | e | The UnifiedVirtualPathEventArgs instance containing the event data. |
Search(UnifiedSearchQuery)
VersioningDirectory search implementation. Uses EPiServer.Search to query for results.
Declaration
public override UnifiedSearchHitCollection Search(UnifiedSearchQuery query)
Parameters
Type | Name | Description |
---|---|---|
UnifiedSearchQuery | query |
Returns
Type | Description |
---|---|
UnifiedSearchHitCollection |
Overrides
Remarks
This search will only use the FreeTextQuery and Modified dates part of the query. FileNamePattern, Path and MatchSummary will be ignored.