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
ContentTypeOrder
Default ordered list of content types on a list, before adjustments
IContentTypeIdCollection ContentTypeOrder { get; }
Property Value
Exists
Gets whether the folder exists,
bool Exists { get; }
Property Value
Files
Gets the collection of files contained in the folder
IFileCollection Files { get; }
Property Value
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
IsWOPIEnabled
Indicate whether the folder is enabled for WOPI default action.
bool IsWOPIEnabled { get; }
Property Value
ItemCount
Gets a value that specifies the count of items in the list folder.
int ItemCount { get; }
Property Value
ListItemAllFields
Gets the list item field values for the list item corresponding to the file.
IListItem ListItemAllFields { get; }
Property Value
Name
Gets the name of the folder.
string Name { get; }
Property Value
ParentFolder
Gets the parent list folder of the folder.
IFolder ParentFolder { get; }
Property Value
ProgID
Gets a string that identifies the application in which the folder was created.
string ProgID { get; }
Property Value
Properties
Gets the collection of all properties defined for this folder.
IPropertyValues Properties { get; }
Property Value
ServerRelativeUrl
Gets the server-relative URL of the list folder.
string ServerRelativeUrl { get; }
Property Value
StorageMetrics
Get the storage metrics of the folder.
IStorageMetrics StorageMetrics { get; }
Property Value
TimeCreated
Gets the creation time of the folder.
DateTime TimeCreated { get; }
Property Value
TimeLastModified
Gets the last modification time of the folder.
DateTime TimeLastModified { get; }
Property Value
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
UniqueId
Gets the Unique Id of the folder.
Guid UniqueId { get; }
Property Value
WelcomePage
Gets or sets a value that specifies folder-relative URL for the list folder welcome page.
string WelcomePage { get; set; }
Property Value
Methods
AddFolder(string)
Add a folder to the current folder.
IFolder AddFolder(string name)
Parameters
namestringThe 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
namestringThe name of the folder to add.
Returns
AddFolderBatch(Batch, string)
Add a folder to the current folder via batch.
IFolder AddFolderBatch(Batch batch, string name)
Parameters
Returns
- IFolder
The added folder.
AddFolderBatch(string)
Add a folder to the current folder via batch.
IFolder AddFolderBatch(string name)
Parameters
namestringThe 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
Returns
AddFolderBatchAsync(string)
Add a folder to the current folder via batch.
Task<IFolder> AddFolderBatchAsync(string name)
Parameters
namestringThe name of the folder to add.
Returns
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
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the copy operation.
CopyToAsync(string, MoveCopyOptions)
Copies a folder to the destination URL.
Task CopyToAsync(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the copy operation.
Returns
CopyToBatch(Batch, string, MoveCopyOptions)
Copies a folder to the destination URL.
void CopyToBatch(Batch batch, string destinationUrl, MoveCopyOptions options = null)
Parameters
batchBatchThe batch instance to use.
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the copy operation.
CopyToBatch(string, MoveCopyOptions)
Copies a folder to the destination URL.
void CopyToBatch(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions 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
batchBatchThe batch instance to use.
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the copy operation.
Returns
CopyToBatchAsync(string, MoveCopyOptions)
Copies a folder to the destination URL.
Task CopyToBatchAsync(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the copy operation.
Returns
CreateAnonymousSharingLink(AnonymousLinkOptions)
Creates an anonymous sharing link for a file
IGraphPermission CreateAnonymousSharingLink(AnonymousLinkOptions anonymousLinkOptions)
Parameters
anonymousLinkOptionsAnonymousLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateAnonymousSharingLinkAsync(AnonymousLinkOptions)
Creates an anonymous sharing link for a file
Task<IGraphPermission> CreateAnonymousSharingLinkAsync(AnonymousLinkOptions anonymousLinkOptions)
Parameters
anonymousLinkOptionsAnonymousLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
CreateOrganizationalSharingLink(OrganizationalLinkOptions)
Creates an organization sharing link for a file
IGraphPermission CreateOrganizationalSharingLink(OrganizationalLinkOptions organizationalLinkOptions)
Parameters
organizationalLinkOptionsOrganizationalLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions)
Creates an organization sharing link for a file
Task<IGraphPermission> CreateOrganizationalSharingLinkAsync(OrganizationalLinkOptions organizationalLinkOptions)
Parameters
organizationalLinkOptionsOrganizationalLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
CreateSharingInvite(InviteOptions)
Creates a sharing invite to a specific user
IGraphPermission CreateSharingInvite(InviteOptions inviteOptions)
Parameters
inviteOptionsInviteOptions
Returns
- IGraphPermission
Permission that has been created
CreateSharingInviteAsync(InviteOptions)
Creates a sharing invite to a specific user
Task<IGraphPermission> CreateSharingInviteAsync(InviteOptions inviteOptions)
Parameters
inviteOptionsInviteOptions
Returns
- Task<IGraphPermission>
Permission that has been created
CreateUserSharingLink(UserLinkOptions)
Creates a user sharing link for a file
IGraphPermission CreateUserSharingLink(UserLinkOptions userLinkOptions)
Parameters
userLinkOptionsUserLinkOptions
Returns
- IGraphPermission
Permission that has been created
CreateUserSharingLinkAsync(UserLinkOptions)
Creates a user sharing link for a file
Task<IGraphPermission> CreateUserSharingLinkAsync(UserLinkOptions userLinkOptions)
Parameters
userLinkOptionsUserLinkOptions
Returns
- Task<IGraphPermission>
Permission that has been created
DeleteShareLinks()
Deletes the share links on the file item
void DeleteShareLinks()
DeleteShareLinksAsync()
Deletes the share links on the file item
Task DeleteShareLinksAsync()
Returns
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
folderRelativeUrlstringa (hierarchy) of folders (e.g. folderA/folderB/FolderC)
expressionsExpression<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
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
folderRelativeUrlstringa (hierarchy) of folders (e.g. folderA/folderB/FolderC)
expressionsExpression<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
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
matchstring
Returns
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
matchstring
Returns
GetShareLinks()
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
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the move operation.
MoveToAsync(string, MoveCopyOptions)
Moves a folder to the destination URL.
Task MoveToAsync(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the move operation.
Returns
MoveToBatch(Batch, string, MoveCopyOptions)
Moves a folder to the destination URL.
void MoveToBatch(Batch batch, string destinationUrl, MoveCopyOptions options = null)
Parameters
batchBatchThe batch instance to use.
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the move operation.
MoveToBatch(string, MoveCopyOptions)
Moves a folder to the destination URL.
void MoveToBatch(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions 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
batchBatchThe batch instance to use.
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the move operation.
Returns
MoveToBatchAsync(string, MoveCopyOptions)
Moves a folder to the destination URL.
Task MoveToBatchAsync(string destinationUrl, MoveCopyOptions options = null)
Parameters
destinationUrlstringThe destination URL.
optionsMoveCopyOptionsoptions of the move operation.
Returns
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
RecycleBatch()
Send the file to recycle bin.
IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch()
Returns
RecycleBatch(Batch)
Send the file to recycle bin
IBatchSingleResult<BatchResultValue<Guid>> RecycleBatch(Batch batch)
Parameters
batchBatchThe batch instance to use.
Returns
RecycleBatchAsync()
Send the file to recycle bin.
Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync()
Returns
RecycleBatchAsync(Batch)
Send the file to recycle bin.
Task<IBatchSingleResult<BatchResultValue<Guid>>> RecycleBatchAsync(Batch batch)
Parameters
batchBatchThe batch instance to use.
Returns
Rename(string)
Renames a folder
void Rename(string name)
Parameters
namestringNew folder name
RenameAsync(string)
Renames a folder
Task RenameAsync(string name)
Parameters
namestringNew folder name