Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IBasicFileService<TEntity>

    Provides basic file operations for entities that implement IFile.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IBasicFileService<TEntity> where TEntity : IFile
    Type Parameters
    Name Description
    TEntity

    The type of file entity.

    Methods

    View Source

    GetAllAsync(params string[])

    Gets all TEntity by path, or all if no paths are specified.

    Declaration
    Task<IEnumerable<TEntity>> GetAllAsync(params string[] paths)
    Parameters
    Type Name Description
    string[] paths

    Optional paths of TEntity to get.

    Returns
    Type Description
    Task<IEnumerable<TEntity>>

    IEnumerable of TEntity.

    View Source

    GetAsync(string)

    Gets TEntity by path.

    Declaration
    Task<TEntity?> GetAsync(string path)
    Parameters
    Type Name Description
    string path

    The path to get TEntity from.

    Returns
    Type Description
    Task<TEntity>

    TEntity, or null if not found.

    View Source

    GetContentStreamAsync(string)

    Get the content of a file as a stream.

    Declaration
    Task<Stream> GetContentStreamAsync(string path)
    Parameters
    Type Name Description
    string path

    The path to the file.

    Returns
    Type Description
    Task<Stream>

    A stream containing the contents of the file.

    View Source

    GetFileSizeAsync(string)

    Gets the size of a file in bytes.

    Declaration
    Task<long> GetFileSizeAsync(string path)
    Parameters
    Type Name Description
    string path

    The path to the file.

    Returns
    Type Description
    Task<long>

    The file size in bytes.

    View Source

    SetContentStreamAsync(string, Stream)

    Set the content of a file from a stream.

    Declaration
    Task SetContentStreamAsync(string path, Stream content)
    Parameters
    Type Name Description
    string path

    The path to the file.

    Stream content

    The desired content of the file as a stream.

    Returns
    Type Description
    Task
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX