Interface IFolderManager
Do not implement. This interface is meant for reference and unit test purposes only. There is no guarantee that this interface will not change.
Namespace: DotNetNuke.Services.FileSystem
Assembly: DotNetNuke.dll
Syntax
public interface IFolderManager
Properties
| Improve this Doc View SourceMyFolderName
Gets the alias name of the personal User Folder.
Declaration
string MyFolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceAddAllUserReadPermission(IFolderInfo, PermissionInfo)
Adds read permissions for all users to the specified folder.
Declaration
void AddAllUserReadPermission(IFolderInfo folder, PermissionInfo permission)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to add the permission to. |
PermissionInfo | permission | Used as base class for FolderPermissionInfo when there is no read permission already defined. |
AddFolder(FolderMappingInfo, String, String)
Creates a new folder using the provided folder path and mapping.
Declaration
IFolderInfo AddFolder(FolderMappingInfo folderMapping, string folderPath, string mappedPath)
Parameters
Type | Name | Description |
---|---|---|
FolderMappingInfo | folderMapping | The folder mapping to use. |
System.String | folderPath | The path of the new folder. |
System.String | mappedPath | The path of the new folder in the provider. |
Returns
Type | Description |
---|---|
IFolderInfo | The added folder. |
AddFolder(FolderMappingInfo, String)
Creates a new folder using the provided folder path and mapping.
Declaration
IFolderInfo AddFolder(FolderMappingInfo folderMapping, string folderPath)
Parameters
Type | Name | Description |
---|---|---|
FolderMappingInfo | folderMapping | The folder mapping to use. |
System.String | folderPath | The path of the new folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The added folder. |
AddFolder(Int32, String)
Creates a new folder in the given portal using the provided folder path. The same mapping than the parent folder will be used to create this folder. So this method have to be used only to create subfolders.
Declaration
IFolderInfo AddFolder(int portalId, string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.String | folderPath | The path of the new folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The added folder. |
CopyParentFolderPermissions(IFolderInfo)
Sets folder permissions to the given folder by copying parent folder permissions.
Declaration
void CopyParentFolderPermissions(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to copy permissions to. |
DeleteFolder(IFolderInfo, ICollection<IFolderInfo>)
Delete the specified folder and all its content.
Declaration
void DeleteFolder(IFolderInfo folder, ICollection<IFolderInfo> notDeletedSubfolders)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to delete>. |
ICollection<IFolderInfo> | notDeletedSubfolders | A collection with all not deleted subfolders. |
DeleteFolder(IFolderInfo)
Deletes the specified folder.
Declaration
void DeleteFolder(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to delete. |
DeleteFolder(Int32)
Deletes the specified folder.
Declaration
void DeleteFolder(int folderId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | The folder identifier. |
FolderExists(Int32, String)
Checks the existence of the specified folder in the specified portal.
Declaration
bool FolderExists(int portalId, string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal where to check the existence of the folder. |
System.String | folderPath | The path of folder to check the existence of. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating whether the folder exists or not in the specified portal. |
GetFiles(IFolderInfo, Boolean, Boolean)
Gets the files contained in the specified folder.
Declaration
IEnumerable<IFileInfo> GetFiles(IFolderInfo folder, bool recursive, bool retrieveUnpublishedFiles)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder from which to retrieve the files. |
System.Boolean | recursive | Whether or not to include all the subfolders. |
System.Boolean | retrieveUnpublishedFiles | Indicates if the file is retrieved from All files or from Published files. |
Returns
Type | Description |
---|---|
IEnumerable<IFileInfo> | The list of files contained in the specified folder. |
GetFiles(IFolderInfo, Boolean)
Gets the files contained in the specified folder.
Declaration
IEnumerable<IFileInfo> GetFiles(IFolderInfo folder, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder from which to retrieve the files. |
System.Boolean | recursive | Whether or not to include all the subfolders. |
Returns
Type | Description |
---|---|
IEnumerable<IFileInfo> | The list of files contained in the specified folder. |
GetFiles(IFolderInfo)
Gets the files contained in the specified folder.
Declaration
IEnumerable<IFileInfo> GetFiles(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder from which to retrieve the files. |
Returns
Type | Description |
---|---|
IEnumerable<IFileInfo> | The list of files contained in the specified folder. |
GetFileSystemFolders(UserInfo, String)
Gets the list of Standard folders the specified user has the provided permissions.
Declaration
IEnumerable<IFolderInfo> GetFileSystemFolders(UserInfo user, string permissions)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user info. |
System.String | permissions | The permissions the folders have to met. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of Standard folders the specified user has the provided permissions. |
Remarks
This method is used to support legacy behaviours and situations where we know the file/folder is in the file system.
GetFolder(Guid)
Gets a folder entity by providing its unique id.
Declaration
IFolderInfo GetFolder(Guid uniqueId)
Parameters
Type | Name | Description |
---|---|---|
Guid | uniqueId | The unique id of the folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The folder entity or null if the folder cannot be located. |
GetFolder(Int32, String)
Gets a folder entity by providing a portal identifier and folder path.
Declaration
IFolderInfo GetFolder(int portalId, string folderPath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal where the folder exists. |
System.String | folderPath | The path of the folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The folder entity or null if the folder cannot be located. |
GetFolder(Int32)
Gets a folder entity by providing a portal identifier and folder identifier.
Declaration
IFolderInfo GetFolder(int folderId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | The identifier of the folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The folder entity or null if the folder cannot be located. |
GetFolders(UserInfo, String)
Gets the list of folders the specified user has the provided permissions.
Declaration
IEnumerable<IFolderInfo> GetFolders(UserInfo user, string permissions)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user info. |
System.String | permissions | The permissions the folders have to met. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of folders the specified user has the provided permissions. |
GetFolders(UserInfo)
Gets the list of folders the specified user has read permissions.
Declaration
IEnumerable<IFolderInfo> GetFolders(UserInfo user)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | user | The user info. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of folders the specified user has read permissions. |
GetFolders(IFolderInfo)
Gets the list of subfolders for the specified folder.
Declaration
IEnumerable<IFolderInfo> GetFolders(IFolderInfo parentFolder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | parentFolder | The folder to get the list of subfolders. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of subfolders for the specified folder. |
GetFolders(Int32, Boolean)
Gets the sorted list of folders of the provided portal.
Declaration
IEnumerable<IFolderInfo> GetFolders(int portalId, bool useCache)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.Boolean | useCache | True = Read from Cache, False = Read from DB. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The sorted list of folders of the provided portal. |
GetFolders(Int32, String, Int32)
Gets the sorted list of folders that match the provided permissions in the specified portal.
Declaration
IEnumerable<IFolderInfo> GetFolders(int portalId, string permissions, int userId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.String | permissions | The permissions to match. |
System.Int32 | userId | The user identifier to be used to check permissions. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of folders that match the provided permissions in the specified portal. |
GetFolders(Int32)
Gets the sorted list of folders of the provided portal.
Declaration
IEnumerable<IFolderInfo> GetFolders(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The sorted list of folders of the provided portal. |
GetUserFolder(UserInfo)
Get the users folder.
Declaration
IFolderInfo GetUserFolder(UserInfo userInfo)
Parameters
Type | Name | Description |
---|---|---|
UserInfo | userInfo | the user. |
Returns
Type | Description |
---|---|
IFolderInfo | FolderInfo for the users folder. |
MoveFolder(IFolderInfo, IFolderInfo)
Moves the specified folder and its contents to a new location.
Declaration
IFolderInfo MoveFolder(IFolderInfo folder, IFolderInfo destinationFolder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to move. |
IFolderInfo | destinationFolder | The destination folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The moved folder. |
MoveFolder(IFolderInfo, String)
Moves the specified folder and its contents to a new location.
Declaration
IFolderInfo MoveFolder(IFolderInfo folder, string newFolderPath)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to move. |
System.String | newFolderPath | The new folder path. |
Returns
Type | Description |
---|---|
IFolderInfo | The moved folder. |
RenameFolder(IFolderInfo, String)
Renames the specified folder by setting the new provided folder name.
Declaration
void RenameFolder(IFolderInfo folder, string newFolderName)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to rename. |
System.String | newFolderName | The new name to apply to the folder. |
SearchFiles(IFolderInfo, String, Boolean)
Search the files contained in the specified folder, for a matching pattern.
Declaration
IEnumerable<IFileInfo> SearchFiles(IFolderInfo folder, string pattern, bool recursive = false)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder from which to retrieve the files. |
System.String | pattern | The patter to search for. |
System.Boolean | recursive | Whether or not to include all the subfolders. |
Returns
Type | Description |
---|---|
IEnumerable<IFileInfo> | The list of files contained in the specified folder. |
SetFolderPermission(IFolderInfo, Int32, Int32, Int32)
Sets specific folder permissions for the given role/user to the given folder.
Declaration
void SetFolderPermission(IFolderInfo folder, int permissionId, int roleId, int userId)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to set permission to. |
System.Int32 | permissionId | The id of the permission to assign. |
System.Int32 | roleId | The role to assign the permission to. |
System.Int32 | userId | The user to assign the permission to. |
SetFolderPermission(IFolderInfo, Int32, Int32)
Sets specific folder permissions for the given role to the given folder.
Declaration
void SetFolderPermission(IFolderInfo folder, int permissionId, int roleId)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to set permission to. |
System.Int32 | permissionId | The id of the permission to assign. |
System.Int32 | roleId | The role to assign the permission to. |
SetFolderPermissions(IFolderInfo, Int32)
Sets folder permissions for administrator role to the given folder.
Declaration
void SetFolderPermissions(IFolderInfo folder, int administratorRoleId)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to set permission to. |
System.Int32 | administratorRoleId | The administrator role id to assign the permission to. |
Synchronize(Int32, String, Boolean, Boolean)
Synchronizes the specified folder, its files and, optionally, its subfolders.
Declaration
int Synchronize(int portalId, string relativePath, bool isRecursive, bool syncFiles)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.String | relativePath | The relative path of the folder. |
System.Boolean | isRecursive | Indicates if the synchronization has to be recursive. |
System.Boolean | syncFiles | Indicates if files need to be synchronized. |
Returns
Type | Description |
---|---|
System.Int32 | The number of folder collisions. |
Synchronize(Int32, String)
Synchronizes the specified folder, its files and its subfolders.
Declaration
int Synchronize(int portalId, string relativePath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
System.String | relativePath | The relative path of the folder. |
Returns
Type | Description |
---|---|
System.Int32 | The number of folder collisions. |
Synchronize(Int32)
Synchronizes the entire folder tree for the specified portal.
Declaration
int Synchronize(int portalId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | portalId | The portal identifier. |
Returns
Type | Description |
---|---|
System.Int32 | The number of folder collisions. |
UnlinkFolder(IFolderInfo)
Unlink the specified folder.
Declaration
void UnlinkFolder(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to unlink. |
UpdateFolder(IFolderInfo)
Updates metadata of the specified folder.
Declaration
IFolderInfo UpdateFolder(IFolderInfo folder)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | The folder to update. |
Returns
Type | Description |
---|---|
IFolderInfo | The updated folder. |