Class AssetManager
Implements
Inherited Members
Namespace: DotNetNuke.Services.Assets
Assembly: DotNetNuke.dll
Syntax
public class AssetManager : ComponentBase<IAssetManager, AssetManager>, IAssetManager
Methods
| Improve this Doc View SourceApplyOrder<T>(IQueryable<T>, String, Boolean)
Declaration
public static IOrderedQueryable<T> ApplyOrder<T>(IQueryable<T> source, string propertyName, bool asc)
Parameters
Type | Name | Description |
---|---|---|
IQueryable<T> | source | |
System.String | propertyName | |
System.Boolean | asc |
Returns
Type | Description |
---|---|
IOrderedQueryable<T> |
Type Parameters
Name | Description |
---|---|
T |
CreateFolder(String, Int32, Int32, String)
Creates a new folder.
Declaration
public IFolderInfo CreateFolder(string folderName, int folderParentId, int folderMappingId, string mappedPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderName | folderName is the name of the new folder. |
System.Int32 | folderParentId | The reference to the parent folder where the new folder will be create. |
System.Int32 | folderMappingId | folderMappingID is the mapping related with the new folder. |
System.String | mappedPath | mappedPath used for the mapping to folder in remove provider. |
Returns
Type | Description |
---|---|
IFolderInfo | The newly folder created under the specified parent folder. |
DeleteFile(Int32)
Deletes an existing file.
Declaration
public bool DeleteFile(int fileId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fileId | The ide of the folder to delete. |
Returns
Type | Description |
---|---|
System.Boolean | True if the file has been correctly deleted, false otherwise. |
DeleteFolder(Int32, Boolean, ICollection<IFolderInfo>)
Deletes an existing folder.
Declaration
public bool DeleteFolder(int folderId, bool onlyUnlink, ICollection<IFolderInfo> nonDeletedSubfolders)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | The ide of the folder to delete. |
System.Boolean | onlyUnlink | In case of a remote folder, specifies that the folder should be unlinked, not deleted. |
ICollection<IFolderInfo> | nonDeletedSubfolders | The list of subfolders that could not be deleted, for example due to permissions. |
Returns
Type | Description |
---|---|
System.Boolean | True if the folder has been correctly deleted, false otherwise. |
GetFolderContent(Int32, Int32, Int32, String, SubfolderFilter)
Gets the page of files and folders contained in the specified folder.
Declaration
public ContentPage GetFolderContent(int folderId, int startIndex, int numItems, string sortExpression = null, SubfolderFilter subfolderFilter = default(SubfolderFilter))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | Folder Identifier. |
System.Int32 | startIndex | Start index to retrieve items. |
System.Int32 | numItems | Max Number of items. |
System.String | sortExpression | The sort expression in a SQL format, e.g. FileName ASC. |
SubfolderFilter | subfolderFilter |
Returns
Type | Description |
---|---|
ContentPage | The list of files and folders contained in the specified folder paginated. |
GetFolders(IFolderInfo, String, Boolean)
Gets the list of subfolders for the specified folder.
Declaration
public IEnumerable<IFolderInfo> GetFolders(IFolderInfo parentFolder, string orderingField, bool asc)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | parentFolder | The folder from where to get the list of subfolders. |
System.String | orderingField | The field to order the list. |
System.Boolean | asc | True to order ascending, false to order descending. |
Returns
Type | Description |
---|---|
IEnumerable<IFolderInfo> | The list of subfolders for the specified folder. |
HasPermission(IFolderInfo, String)
Declaration
public static bool HasPermission(IFolderInfo folder, string permissionKey)
Parameters
Type | Name | Description |
---|---|---|
IFolderInfo | folder | |
System.String | permissionKey |
Returns
Type | Description |
---|---|
System.Boolean |
RenameFile(Int32, String)
Renames a existing file.
Declaration
public IFileInfo RenameFile(int fileId, string newFileName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | fileId | File reference to rename. |
System.String | newFileName | The new name to set to the file. |
Returns
Type | Description |
---|---|
IFileInfo | The final renamed file. |
RenameFolder(Int32, String)
Renames a existing folder.
Declaration
public IFolderInfo RenameFolder(int folderId, string newFolderName)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | Folder reference to rename. |
System.String | newFolderName | The new name to set to the folder. |
Returns
Type | Description |
---|---|
IFolderInfo | The final renamed folder. |
SearchFolderContent(Int32, String, Int32, Int32, String, SubfolderFilter)
Searches the files and folders contained in the specified folder.
Declaration
public ContentPage SearchFolderContent(int folderId, string pattern, int startIndex, int numItems, string sortExpression = null, SubfolderFilter subfolderFilter = default(SubfolderFilter))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | folderId | Folder Identifier. |
System.String | pattern | The pattern to search for. |
System.Int32 | startIndex | Start index to retrieve items. |
System.Int32 | numItems | Max Number of items. |
System.String | sortExpression | The sort expression in a SQL format, e.g. FileName ASC. |
SubfolderFilter | subfolderFilter |
Returns
Type | Description |
---|---|
ContentPage | The list of files and folders contained in the specified folder paginated. |