Interface IResourceStorage
Interface defining specialized storage operations for resource management in the WebReportDesigner system.
Inherited Members
Namespace: Telerik.WebReportDesigner.Services
Assembly: Telerik.WebReportDesigner.Services.dll
Syntax
public interface IResourceStorage : IAssetsStorage
Remarks
Extends IAssetsStorage with additional resource-specific functionality including name-based operations, move operations, overwrite capabilities, and search functionality. Provides comprehensive resource management for the Assets Manager and related WebReportDesigner components.
Methods
FolderExists(String)
Determines if a folder exists by its URI.
Declaration
bool FolderExists(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the folder. |
Returns
|
System.Boolean
true, if the folder exists, else false |
Remarks
Provides URI-based folder existence checking for validation and resource management operations. Consider using GetFolderAsync for more comprehensive folder information.
FolderHasContents(String)
Determines if a folder contains any resources or subfolders.
Declaration
bool FolderHasContents(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the folder |
Returns
|
System.Boolean
true, if the folder has contents, else false |
Remarks
Useful for UI optimizations to determine whether to show folder expansion indicators and for validation before folder operations. Consider using GetFolderContentsAsync for more detailed content information.
FolderNameExists(String)
Determines if a folder exists by its name path.
Declaration
bool FolderNameExists(string folderName)
Parameters
|
System.String
folderName
The path to the folder using Name identifiers. |
Returns
|
System.Boolean
true, if the folder exists, else false |
Remarks
Provides name-based folder existence checking for validation operations and hierarchical folder management scenarios.
GetAllByExtension(String[])
Retrieves all resource files that match the specified file extensions.
Declaration
IEnumerable<ResourceFileModel> GetAllByExtension(string[] extensions)
Parameters
|
System.String[]
extensions
The file extensions to filter by (e.g., ".jpg", ".png"). |
Returns
|
System.Collections.Generic.IEnumerable<ResourceFileModel>
An enumerable collection of ResourceFileModel objects matching the specified extensions. |
Remarks
Useful for filtering resources by type in the Assets Manager, enabling users to view only specific file types such as images or documents.
GetByUri(String)
Retrieves the raw content of a resource by its URI.
Declaration
byte[] GetByUri(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the resource. |
Returns
|
System.Byte[]
The resource content as a byte array. |
Remarks
Provides direct access to resource binary data for processing, manipulation, or serving operations within the WebReportDesigner system.
GetFile(String)
Retrieves a resource file with download-ready data and metadata.
Declaration
ResourceFileDataModel GetFile(string resourceUri)
Parameters
|
System.String
resourceUri
The URI of the resource. |
Returns
|
ResourceFileDataModel
ResourceFileDataModel, containing the information about the resource. |
Remarks
Combines resource content with metadata including MIME type and name, optimized for download operations and HTTP response scenarios.
GetFolderByName(String)
Retrieves the folder model by its name path.
Declaration
ResourceFolderModel GetFolderByName(string folderName)
Parameters
|
System.String
folderName
The path to the folder using Name identifiers. |
Returns
|
ResourceFolderModel
The ResourceFolderModel of the obtained folder. |
Remarks
Enables folder lookup using hierarchical name paths rather than URIs, providing an alternative access method for folder navigation operations.
GetModelByName(String)
Retrieves resource information by its name path.
Declaration
ResourceFileModel GetModelByName(string resourceName)
Parameters
|
System.String
resourceName
The full path to the resource using Name identifiers. |
Returns
|
ResourceFileModel
ResourceFileModel, containing the information about the resource. |
Remarks
Enables resource lookup using hierarchical name paths rather than URIs, providing an alternative access method for resource management operations.
Move(MoveResourceModel)
Moves a resource to a new parent location.
Declaration
ResourceFileModel Move(MoveResourceModel model)
Parameters
|
MoveResourceModel
model
The model containing the move operation data |
Returns
|
ResourceFileModel
ResourceFileModel, containing the information about the moved resource. |
Remarks
Relocates the resource file while preserving its content and updating all necessary references within the storage system.
MoveFolder(MoveFolderModel)
Moves a folder and all its contents to a new parent location.
Declaration
ResourceFolderModel MoveFolder(MoveFolderModel model)
Parameters
|
MoveFolderModel
model
The model containing the move operation data |
Returns
|
ResourceFolderModel
The ResourceFolderModel of the moved folder |
Remarks
Relocates the entire folder structure while preserving all contents and maintaining referential integrity within the storage system.
Overwrite(OverwriteResourceModel, Byte[])
Overwrites an existing resource with new content.
Declaration
ResourceFileModel Overwrite(OverwriteResourceModel model, byte[] resource)
Parameters
|
OverwriteResourceModel
model
The model containing the overwrite operation data |
|
System.Byte[]
resource
The new contents of the resource |
Returns
|
ResourceFileModel
ResourceFileModel, containing the information about the updated resource. |
Remarks
Replaces the content of an existing resource while preserving its location and basic metadata, useful for updating resources without changing their references.
ResourceExists(String)
Determines if a resource exists at the specified URI.
Declaration
bool ResourceExists(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the resource. |
Returns
|
System.Boolean
true, if the resource exists, else false. |
Remarks
Enables validation of resource references and existence checking before performing operations that depend on resource availability.
ResourceNameExists(String)
Determines if a resource exists by its name path.
Declaration
bool ResourceNameExists(string resourceName)
Parameters
|
System.String
resourceName
The full path to the resource using Name identifiers. |
Returns
|
System.Boolean
true, if the resource exists, else false. |
Remarks
Provides name-based resource existence checking for validation operations and resource management scenarios that use hierarchical naming.
Save(String, Byte[])
Saves resource content and returns the file location.
Declaration
[Obsolete("Telerik.WebReportDesigner.Services.IResourceStorage.Save(string, byte[]) is now obsolete. Please use Telerik.WebReportDesigner.Services.IResourceStorage.Save(SaveResourceModel, byte[])", false)]
string Save(string resourceName, byte[] resource)
Parameters
|
System.String
resourceName
The name and path of the resource to save. |
|
System.Byte[]
resource
The resource content as a byte array. |
Returns
|
System.String
The file location string. |
Remarks
This method is obsolete. Use the overload that accepts SaveResourceModel for better parameter validation and consistent API patterns.
Search(SearchResourcesModel)
Searches for resources within a specified folder using pattern matching.
Declaration
IEnumerable<ResourceModelBase> Search(SearchResourcesModel model)
Parameters
|
SearchResourcesModel
model
The model containing the search operation data |
Returns
|
System.Collections.Generic.IEnumerable<ResourceModelBase>
The search results, both files and folders, as an enumerable of ResourceModelBase |
Remarks
Enables pattern-based resource discovery within specific folder scopes, supporting search functionality in the Assets Manager and resource management interfaces.