InterfaceIResourceStorage
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
Inherited Members
Methods
FolderExists(string)
Determines if a folder exists by its URI.
Declaration
bool FolderExists(string uri)
Parameters
uri
string
The unique resource identifier (URI) of the folder.
Returns
bool
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
uri
string
The unique resource identifier (URI) of the folder
Returns
bool
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
folderName
string
The path to the folder using Name identifiers.
Returns
bool
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
extensions
string[]
The file extensions to filter by (e.g., ".jpg", ".png").
Returns
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
uri
string
The unique resource identifier (URI) of the resource.
Returns
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
resourceUri
string
The URI of the resource.
Returns
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
folderName
string
The path to the folder using Name identifiers.
Returns
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
resourceName
string
The full path to the resource using Name identifiers.
Returns
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
model
The model containing the move operation data
Returns
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
model
The model containing the move operation data
Returns
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
model
The model containing the overwrite operation data
resource
byte[]
The new contents of the resource
Returns
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
uri
string
The unique resource identifier (URI) of the resource.
Returns
bool
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
resourceName
string
The full path to the resource using Name identifiers.
Returns
bool
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
resourceName
string
The name and path of the resource to save.
resource
byte[]
The resource content as a byte array.
Returns
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
model
The model containing the search operation data
Returns
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.