Table of Contents

Interface IFolder

Namespace
PnP.Core.Model.SharePoint
Assembly
PnP.Core.dll

Public interface to define a Folder object

public interface IFolder : IDataModel<IFolder>, IDataModelParent, IDataModelWithContext, ISupportModules<IFolder>, IDataModelGet<IFolder>, IDataModelLoad<IFolder>, IDataModelUpdate, IDataModelDelete, IDataModelSupportingGetChanges, IQueryableDataModel
Inherited Members
Extension Methods

Properties

All

A special property used to add an asterisk to a $select statement

object All { get; }

Property Value

object

ContentTypeOrder

Default ordered list of content types on a list, before adjustments

IContentTypeIdCollection ContentTypeOrder { get; }

Property Value

IContentTypeIdCollection

Exists

Gets whether the folder exists,

bool Exists { get; }

Property Value

bool

Files

Gets the collection of files contained in the folder

IFileCollection Files { get; }

Property Value

IFileCollection

Folders

Gets the collection of list folders contained in the list folder. Implements IQueryable<T>.
See Requesting model collections and IQueryable performance considerations to learn more.

IFolderCollection Folders { get; }

Property Value

IFolderCollection

IsWOPIEnabled

Indicate whether the folder is enabled for WOPI default action.

bool IsWOPIEnabled { get; }

Property Value

bool

ItemCount

Gets a value that specifies the count of items in the list folder.

int ItemCount { get; }

Property Value

int

ListItemAllFields

Gets the list item field values for the list item corresponding to the file.

IListItem ListItemAllFields { get; }

Property Value

IListItem

Name

Gets the name of the folder.

string Name { get; }

Property Value

string

ParentFolder

Gets the parent list folder of the folder.

IFolder ParentFolder { get; }

Property Value

IFolder

ProgID

Gets a string that identifies the application in which the folder was created.

string ProgID { get; }

Property Value

string

Properties

Gets the collection of all properties defined for this folder.

IPropertyValues Properties { get; }

Property Value

IPropertyValues

ServerRelativeUrl

Gets the server-relative URL of the list folder.

string ServerRelativeUrl { get; }

Property Value

string

StorageMetrics

Get the storage metrics of the folder.

IStorageMetrics StorageMetrics { get; }

Property Value

IStorageMetrics

TimeCreated

Gets the creation time of the folder.

DateTime TimeCreated { get; }

Property Value

DateTime

TimeLastModified

Gets the last modification time of the folder.

DateTime TimeLastModified { get; }

Property Value

DateTime

UniqueContentTypeOrder

Ordered list of content types on a list: controls order of items in the "New" menu and "List Settings" page

IContentTypeIdCollection UniqueContentTypeOrder { get; }

Property Value

IContentTypeIdCollection

UniqueId

Gets the Unique Id of the folder.

Guid UniqueId { get; }

Property Value

Guid

WelcomePage

Gets or sets a value that specifies folder-relative URL for the list folder welcome page.

string WelcomePage { get; set; }

Property Value

string

Methods

AddFolder(string)

Add a folder to the current folder.

IFolder AddFolder(string name)

Parameters

name string

The name of the folder to add.

Returns

IFolder

The added folder.

AddFolderAsync(string)

Add a folder to the current folder.

Task<IFolder> AddFolderAsync(string name)

Parameters

name string

The name of the folder to add.

Returns

Task<IFolder>

The added folder.

AddFolderBatch(Batch, string)

Add a folder to the current folder via batch.

IFolder AddFolderBatch(Batch batch, string name)

Parameters

batch Batch

Batch to add the reques to

name string

The name of the folder to add.

Returns

IFolder

The added folder.

AddFolderBatch(string)

Add a folder to the current folder via batch.

IFolder AddFolderBatch(string name)

Parameters

name string

The name of the folder to add.

Returns

IFolder

The added folder.

AddFolderBatchAsync(Batch, string)

Add a folder to the current folder via batch.

Task<IFolder> AddFolderBatchAsync(Batch batch, string name)

Parameters

batch Batch

Batch to add the reques to

name string

The name of the folder to add.

Returns

Task<IFolder>

The added folder.

AddFolderBatchAsync(string)

Add a folder to the current folder via batch.

Task<IFolder> AddFolderBatchAsync(string name)

Parameters

name string

The name of the folder to add.

Returns

Task<IFolder>

The added folder.

ClassifyAndExtractOffPeak()

Classifies and extracts all unprocessed files in this folder and it's sub folders via the Syntex off-peak queue

ISyntexClassifyAndExtractResult ClassifyAndExtractOffPeak()

Returns

ISyntexClassifyAndExtractResult

Information about the created classify and extract requests

ClassifyAndExtractOffPeakAsync()

Classifies and extracts all unprocessed files in this folder and it's sub folders via the Syntex off-peak queue

Task<ISyntexClassifyAndExtractResult> ClassifyAndExtractOffPeakAsync()

Returns

Task<ISyntexClassifyAndExtractResult>

Information about the created classify and extract requests

CopyTo(string, MoveCopyOptions)

Copies a folder to the destination URL.

void CopyTo(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

CopyToAsync(string, MoveCopyOptions)

Copies a folder to the destination URL.

Task CopyToAsync(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

Returns

Task

CopyToBatch(Batch, string, MoveCopyOptions)

Copies a folder to the destination URL.

void CopyToBatch(Batch batch, string destinationUrl, MoveCopyOptions options = null)

Parameters

batch Batch

The batch instance to use.

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

CopyToBatch(string, MoveCopyOptions)

Copies a folder to the destination URL.

void CopyToBatch(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

CopyToBatchAsync(Batch, string, MoveCopyOptions)

Copies a folder to the destination URL.

Task CopyToBatchAsync(Batch batch, string destinationUrl, MoveCopyOptions options = null)

Parameters

batch Batch

The batch instance to use.

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

Returns

Task

CopyToBatchAsync(string, MoveCopyOptions)

Copies a folder to the destination URL.

Task CopyToBatchAsync(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the copy operation.

Returns

Task

Creates an anonymous sharing link for a file

IGraphPermission CreateAnonymousSharingLink(AnonymousLinkOptions anonymousLinkOptions)

Parameters

anonymousLinkOptions AnonymousLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateAnonymousSharingLinkAsync(AnonymousLinkOptions)

Creates an anonymous sharing link for a file

Task<IGraphPermission> CreateAnonymousSharingLinkAsync(AnonymousLinkOptions anonymousLinkOptions)

Parameters

anonymousLinkOptions AnonymousLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

Creates an organization sharing link for a file

IGraphPermission CreateOrganizationalSharingLink(OrganizationalLinkOptions organizationalLinkOptions)

Parameters

organizationalLinkOptions OrganizationalLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions)

Creates an organization sharing link for a file

Task<IGraphPermission> CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions organizationalLinkOptions)

Parameters

organizationalLinkOptions OrganizationalLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

CreateSharingInvite(InviteOptions)

Creates a sharing invite to a specific user

IGraphPermission CreateSharingInvite(InviteOptions inviteOptions)

Parameters

inviteOptions InviteOptions

Returns

IGraphPermission

Permission that has been created

CreateSharingInviteAsync(InviteOptions)

Creates a sharing invite to a specific user

Task<IGraphPermission> CreateSharingInviteAsync(InviteOptions inviteOptions)

Parameters

inviteOptions InviteOptions

Returns

Task<IGraphPermission>

Permission that has been created

Creates a user sharing link for a file

IGraphPermission CreateUserSharingLink(UserLinkOptions userLinkOptions)

Parameters

userLinkOptions UserLinkOptions

Returns

IGraphPermission

Permission that has been created

CreateUserSharingLinkAsync(UserLinkOptions)

Creates a user sharing link for a file

Task<IGraphPermission> CreateUserSharingLinkAsync(UserLinkOptions userLinkOptions)

Parameters

userLinkOptions UserLinkOptions

Returns

Task<IGraphPermission>

Permission that has been created

Deletes the share links on the file item

void DeleteShareLinks()

DeleteShareLinksAsync()

Deletes the share links on the file item

Task DeleteShareLinksAsync()

Returns

Task

EnsureFolder(string, params Expression<Func<IFolder, object>>[])

Ensures a (hierarchy) of folders exists on a given folder

IFolder EnsureFolder(string folderRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)

Parameters

folderRelativeUrl string

a (hierarchy) of folders (e.g. folderA/folderB/FolderC)

expressions Expression<Func<IFolder, object>>[]

Expressions needed to create the request, only used when the folder exists, if the returned folder was newly created the default properties are returned

Returns

IFolder

The IFolder representing the final folder in the hierarchy (e.g. FolderC)

EnsureFolderAsync(string, params Expression<Func<IFolder, object>>[])

Ensures a (hierarchy) of folders exists on a given folder

Task<IFolder> EnsureFolderAsync(string folderRelativeUrl, params Expression<Func<IFolder, object>>[] expressions)

Parameters

folderRelativeUrl string

a (hierarchy) of folders (e.g. folderA/folderB/FolderC)

expressions Expression<Func<IFolder, object>>[]

Expressions needed to create the request, only used when the folder exists, if the returned folder was newly created the default properties are returned

Returns

Task<IFolder>

The IFolder representing the final folder in the hierarchy (e.g. FolderC)

FindFiles(string)

Find files in the folder, can be slow as it iterates over all the files in the folder and it's sub folders. If performance is key, then try using a search based solution

List<IFile> FindFiles(string match)

Parameters

match string

Returns

List<IFile>

A List<T> of found files as type IFile

FindFilesAsync(string)

Find files in the folder, can be slow as it iterates over all the files in the folder and it's sub folders. If performance is key, then try using a search based solution

Task<List<IFile>> FindFilesAsync(string match)

Parameters

match string

Returns

Task<List<IFile>>

A List<T> of found files as type IFile

Gets the share links on the file item

IGraphPermissionCollection GetShareLinks()

Returns

IGraphPermissionCollection

Collection of share links existing on the file

GetShareLinksAsync()

Gets the share links on the file item

Task<IGraphPermissionCollection> GetShareLinksAsync()

Returns

Task<IGraphPermissionCollection>

Collection of share links existing on the file

MoveTo(string, MoveCopyOptions)

Moves a folder to the destination URL.

void MoveTo(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

MoveToAsync(string, MoveCopyOptions)

Moves a folder to the destination URL.

Task MoveToAsync(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

Returns

Task

MoveToBatch(Batch, string, MoveCopyOptions)

Moves a folder to the destination URL.

void MoveToBatch(Batch batch, string destinationUrl, MoveCopyOptions options = null)

Parameters

batch Batch

The batch instance to use.

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

MoveToBatch(string, MoveCopyOptions)

Moves a folder to the destination URL.

void MoveToBatch(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

MoveToBatchAsync(Batch, string, MoveCopyOptions)

Moves a folder to the destination URL.

Task MoveToBatchAsync(Batch batch, string destinationUrl, MoveCopyOptions options = null)

Parameters

batch Batch

The batch instance to use.

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

Returns

Task

MoveToBatchAsync(string, MoveCopyOptions)

Moves a folder to the destination URL.

Task MoveToBatchAsync(string destinationUrl, MoveCopyOptions options = null)

Parameters

destinationUrl string

The destination URL.

options MoveCopyOptions

options of the move operation.

Returns

Task

Recycle()

Send the file to recycle bin.

Guid Recycle()

Returns

Guid

The Id of the created recycle bin item

RecycleAsync()

Send the file to recycle bin.

Task<Guid> RecycleAsync()

Returns

Task<Guid>

The Id of the created recycle bin item

RecycleBatch()

Send the file to recycle bin.

IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch()

Returns

IBatchSingleResult<BatchResultValue<Guid>>

RecycleBatch(Batch)

Send the file to recycle bin

IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch(Batch batch)

Parameters

batch Batch

The batch instance to use.

Returns

IBatchSingleResult<BatchResultValue<Guid>>

RecycleBatchAsync()

Send the file to recycle bin.

Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync()

Returns

Task<IBatchSingleResult<BatchResultValue<Guid>>>

RecycleBatchAsync(Batch)

Send the file to recycle bin.

Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync(Batch batch)

Parameters

batch Batch

The batch instance to use.

Returns

Task<IBatchSingleResult<BatchResultValue<Guid>>>

Rename(string)

Renames a folder

void Rename(string name)

Parameters

name string

New folder name

RenameAsync(string)

Renames a folder

Task RenameAsync(string name)

Parameters

name string

New folder name

Returns

Task