Interface
IResourceStorage

Interface defining specialized storage operations for resource management in the WebReportDesigner system.

Definition

Methods

FolderExists(string)

Determines if a folder exists by its URI.

Declaration

cs-api-definition
bool FolderExists(string uri)

Parameters

uri

string

The unique resource identifier (URI) of the folder.

Returns

bool

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

cs-api-definition
bool FolderHasContents(string uri)

Parameters

uri

string

The unique resource identifier (URI) of the folder

Returns

bool

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

cs-api-definition
bool FolderNameExists(string folderName)

Parameters

folderName

string

The path to the folder using Name identifiers.

Returns

bool

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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
ResourceFileDataModel GetFile(string resourceUri)

Parameters

resourceUri

string

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

cs-api-definition
ResourceFolderModel GetFolderByName(string folderName)

Parameters

folderName

string

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

cs-api-definition
ResourceFileModel GetModelByName(string resourceName)

Parameters

resourceName

string

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

cs-api-definition
ResourceFileModel Move(MoveResourceModel model)

Parameters

model

MoveResourceModel

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

cs-api-definition
ResourceFolderModel MoveFolder(MoveFolderModel model)

Parameters

model

MoveFolderModel

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

cs-api-definition
ResourceFileModel Overwrite(OverwriteResourceModel model, byte[] resource)

Parameters

model

OverwriteResourceModel

The model containing the overwrite operation data

resource

byte[]

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

cs-api-definition
bool ResourceExists(string uri)

Parameters

uri

string

The unique resource identifier (URI) of the resource.

Returns

bool

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

cs-api-definition
bool ResourceNameExists(string resourceName)

Parameters

resourceName

string

The full path to the resource using Name identifiers.

Returns

bool

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

cs-api-definition
[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

cs-api-definition
IEnumerable<ResourceModelBase> Search(SearchResourcesModel model)

Parameters

model

SearchResourcesModel

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.