Virtual Happy Hour canceled for Friday May 31st.

Try our conversational search powered by Generative AI!

Class NativeDirectory

Implements UnifiedDirectory for a truly native (local physically available) directory. Obtained through VirtualPathNativeProvider.GetDirectory()

Inheritance
System.Object
NativeDirectory
Inherited Members
Namespace: EPiServer.Web.Hosting
Assembly: EPiServer.dll
Version: 7.19.2
Syntax
public class NativeDirectory : UnifiedDirectory, IPageDirectory, IContentDirectory

Constructors

NativeDirectory(VirtualPathUnifiedProvider, String, String, String, Boolean)

Initializes a new instance of the NativeDirectory class.

Declaration
public NativeDirectory(VirtualPathUnifiedProvider provider, string virtualPath, string localPath, string customSummaryVirtualPath, bool bypassAccessCheck)
Parameters
Type Name Description
VirtualPathUnifiedProvider provider

The provider.

System.String virtualPath

The virtual path.

System.String localPath

The local path.

System.String customSummaryVirtualPath

The custom summary virtual path.

System.Boolean bypassAccessCheck

if set to true [bypass access check].

Exceptions
Type Condition
System.IO.DirectoryNotFoundException

Thrown when the path is not a native directory

Fields

cachedParent

The parent for this directory

Declaration
protected UnifiedDirectory cachedParent
Field Value
Type Description
UnifiedDirectory

cachedParentRead

Indicates if parent has been evaluated

Declaration
protected bool cachedParentRead
Field Value
Type Description
System.Boolean

directoryInfo

The wrapped DirectoryInfo object

Declaration
protected DirectoryInfo directoryInfo
Field Value
Type Description
System.IO.DirectoryInfo

Properties

Children

Children (files and directories) for this directory Implementing classas shall NOT apply filtering in this property.

Declaration
public override IEnumerable Children { get; }
Property Value
Type Description
System.Collections.IEnumerable
Overrides

Directories

Subdirectories for this directory Implementing classas shall NOT apply filtering in this property.

Declaration
public override IEnumerable Directories { get; }
Property Value
Type Description
System.Collections.IEnumerable
Overrides

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

IsFirstLevel

Base implementation looks at the virtual path for slashes to determine level in directory tree semantics. If no slashes > 1 its NOT a top level.

Declaration
public override bool IsFirstLevel { get; }
Property Value
Type Description
System.Boolean
Overrides

LocalPath

The local file path

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

Parent

Gets the parent for this directory

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

The parent.

Overrides

Methods

CopyTo(String)

Copies the directory to specified path

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

The dest virtual path.

Overrides

CreateFile(String)

Creates a file in current directory

Declaration
public override UnifiedFile CreateFile(string name)
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
UnifiedFile
Overrides

CreateFile(String, Guid)

Creates a file in current directory with a specified id

Declaration
public override UnifiedFile CreateFile(string name, Guid id)
Parameters
Type Name Description
System.String name

The name.

System.Guid id

The id.

Returns
Type Description
UnifiedFile
Overrides

CreateSubdirectory(String, IContent)

Creates the subdirectory. The access control should be matched against passed content.

Declaration
public UnifiedDirectory CreateSubdirectory(string name, IContent accessValidatingContent)
Parameters
Type Name Description
System.String name

The name.

IContent accessValidatingContent

Content of the access validating.

Returns
Type Description
UnifiedDirectory

CreateSubdirectory(String, PageData)

Creates the subdirectory. The access control should be matched against passed page.

Declaration
public UnifiedDirectory CreateSubdirectory(string name, PageData accessValidatingPage)
Parameters
Type Name Description
System.String name

The name of the new directory

PageData accessValidatingPage

The page to match access against

Returns
Type Description
UnifiedDirectory

A handle to the created directory

CreateSubdirectoryInternal(String)

Creates the actual directory.

Declaration
protected override UnifiedDirectory CreateSubdirectoryInternal(string name)
Parameters
Type Name Description
System.String name

The name.

Returns
Type Description
UnifiedDirectory

the created directory

Overrides
Remarks

This method does not perform any access check and calling method (e.g. CreateSubdirectory(String, IContent))is responsible for access check

Delete()

Deletes this instance.

Declaration
public override void Delete()
Overrides

GetDirectories()

Gets all subdirectories. Internally calls property Directories.

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

InternalMoveCopy(String, Boolean)

The actual Move/Copy operation is performed here. Supports copying/moving to other virtual path providers, in which case the file is read and written as a stream

If copying/moving to the same (or anoter) native directory destination, the underlying FileInfo.CopyTo() / FileInfo.MoveTo() is used for best performance.

Declaration
protected void InternalMoveCopy(string destVirtualPath, bool isMove)
Parameters
Type Name Description
System.String destVirtualPath
System.Boolean isMove

True if a Move operation is to be performced, False if a Copy operation

MoveTo(String)

Moves the directory to specified path

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

The dest virtual path.

Overrides

QueryAccess()

Call Provider's QueryAccess

Declaration
public override AccessLevel QueryAccess()
Returns
Type Description
AccessLevel
Overrides

Implements

Extension Methods