New to Telerik ReportingStart a free 30-day trial

File-based storage implementation for managing report definition files in the WebReportDesigner system.

Definition

Namespace:Telerik.WebReportDesigner.Services

Assembly:Telerik.WebReportDesigner.Services.dll

Syntax:

C#
public class FileDefinitionStorage : FileDefinitionStorageBase, IResourceStorage, IDefinitionStorage, IAssetsStorage

Inheritance: objectResourceStorageBaseResourceStorageFileDefinitionStorageBaseFileDefinitionStorage

Implements: IAssetsStorageIDefinitionStorageIResourceStorage

Inherited Members FileDefinitionStorageBase.GetFolderContents(string, string[])FileDefinitionStorageBase.GetByUri<TDefinitionNotFoundException>(string)FileDefinitionStorageBase.RenameAsync<TInvalidDefinitionNameException>(RenameResourceModel)FileDefinitionStorageBase.SaveAsync<TDefinitionNotFoundException>(SaveResourceModel, byte[])FileDefinitionStorageBase.GetFolderAsync(string)FileDefinitionStorageBase.GetModelAsync(string)FileDefinitionStorageBase.DeleteAsync(string)FileDefinitionStorageBase.Save(SaveResourceModel, byte[], bool, bool)FileDefinitionStorageBase.WrapException<TResult, TDefinitionException, TResourceException>(Func<TResult>)ResourceStorage.GetOrderedDefaultFoldersToCreate()ResourceStorage.GetAllByExtension(string[])ResourceStorage.GetFolderContentsAsync(string)ResourceStorage.FolderHasContents(string)ResourceStorage.GetFolderByName(string)ResourceStorage.CreateFolderAsync(CreateFolderModel)ResourceStorage.MoveFolder(MoveFolderModel)ResourceStorage.RenameFolderAsync(RenameFolderModel)ResourceStorage.DeleteFolderAsync(string)ResourceStorage.FolderNameExists(string)ResourceStorage.FolderExists(string)ResourceStorage.GetAsync(string)ResourceStorage.ResourceNameExists(string)ResourceStorage.ResourceExists(string)ResourceStorage.GetFile(string)ResourceStorage.GetModelByName(string)ResourceStorage.GetModelCore<T>(string)ResourceStorage.Save(string, byte[])ResourceStorage.SaveAsync(SaveResourceModel, byte[], bool)ResourceStorage.SaveCore<T>(SaveResourceModel, byte[], bool)ResourceStorage.Overwrite(OverwriteResourceModel, byte[])ResourceStorage.OverwriteCore<T>(OverwriteResourceModel, byte[])ResourceStorage.RenameCore<T>(RenameResourceModel)ResourceStorage.Move(MoveResourceModel)ResourceStorage.MoveCore<T>(MoveResourceModel)ResourceStorage.Search(SearchResourcesModel)ResourceStorage.CreateDirectory(string[])ResourceStorage.EnsureDefaultFolders()ResourceStorage.CreateDefaultFolder(CreateFolderModel)ResourceStorage.BaseDirResourceStorageBase.defaultFoldersResourceStorageBase.DefaultFoldersToCreateResourceStorageBase.ValidateSavedResourceExtension(string)ResourceStorageBase.IsExtensionValid(string)...

Constructors

Initializes a new instance of the FileDefinitionStorage class.

C#
public FileDefinitionStorage(string baseDir, string[] excludedFolders)
Parameters:baseDirstring

The base directory where the report definitions are stored.

excludedFoldersstring[]

Relative folder paths to be excluded when retrieving folder contents. Wildcards are not supported.

Remarks:

Creates a new storage instance with the ability to exclude specific folders from storage operations, useful for filtering system or temporary directories.

Initializes a new instance of the FileDefinitionStorage class.

C#
public FileDefinitionStorage(string baseDir)
Parameters:baseDirstring

The base directory where the report definitions are stored.

Remarks:

Creates a new storage instance with default configuration, using the specified base directory for report definition files.

Fields

The constant name of the Reports root folder.

C#
public const string RootFolderName = "Reports"
Remarks:

Defines the default root folder name for report definitions in the storage hierarchy.

Properties

Gets the array of allowed report definition file extensions.

C#
protected override string[] FileExtensions { get; }

Overrides: FileDefinitionStorageBase.FileExtensions

Remarks:

Returns the supported report file extensions (.trdx, .trdp, .trbp) for filtering and validation purposes.

Methods

Retrieves a report definition by its URI and returns the content as a byte array.

C#
public override byte[] GetByUri(string uri)
Parameters:uristring

The unique resource identifier (URI) of the definition.

Returns:

byte[]

The report definition content as a byte array.

Overrides: ResourceStorage.GetByUri(string)

Remarks:

Loads the specified report definition file from the storage system, throwing ReportNotFoundException if the file is not found.

Renames a report definition file.

C#
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
Parameters:modelRenameResourceModel

The model containing relevant data used to rename.

Returns:

Task<ResourceFileModel>

A task representing the asynchronous rename operation with the updated resource model.

Overrides: ResourceStorage.RenameAsync(RenameResourceModel)

Implements: IAssetsStorage.RenameAsync(RenameResourceModel)

Remarks:

Updates the report definition filename while preserving its content and location, throwing InvalidReportNameException for invalid names.

Creates a new or overwrites an existing report definition file with the provided content.

C#
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
Parameters:modelSaveResourceModel

The save operation model containing name and location information.

resourcebyte[]

The report definition content as a byte array.

Returns:

Task<ResourceFileModel>

A task representing the asynchronous save operation with the saved resource model.

Overrides: ResourceStorage.SaveAsync(SaveResourceModel, byte[])

Implements: IAssetsStorage.SaveAsync(SaveResourceModel, byte[])

Remarks:

Persists the report definition to the file system, creating directories as needed and throwing ReportNotFoundException for invalid paths.

Validates the provided report definition identifier.

C#
protected override void ValidateDefinitionId(string definitionId)
Parameters:definitionIdstring

The definition identifier to validate.

Overrides: FileDefinitionStorageBase.ValidateDefinitionId(string)

Remarks:

Ensures the definition identifier meets the requirements for report definition naming conventions and throws validation exceptions for invalid identifiers.