Interface IFileRepository
Represents a repository for file operations.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IFileRepository
Methods
View SourceGetFileContentStream(string)
Gets a stream for reading the content of a file.
Declaration
Stream GetFileContentStream(string filepath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filepath | The path to the file. |
Returns
| Type | Description |
|---|---|
| Stream | A stream for reading the file content. |
GetFileSize(string)
Gets the size of a file in bytes.
Declaration
long GetFileSize(string filepath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filepath | The path to the file. |
Returns
| Type | Description |
|---|---|
| long | The size of the file in bytes. |
SetFileContent(string, Stream)
Sets the content of a file.
Declaration
void SetFileContent(string filepath, Stream content)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filepath | The path to the file. |
| Stream | content | The stream containing the content to write. |