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