docs.unity3d.com
    Show / Hide Table of Contents

    Class CloudAssetFileManager

    A class that implements IAssetFileManager to provide asset file controller functionality. Users of this class will require a minimum Asset Manager Consumer role.

    Inheritance
    Object
    CloudAssetFileManager
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Assets
    Syntax
    public sealed class CloudAssetFileManager : IAssetFileManager

    Constructors

    CloudAssetFileManager(IServiceHttpClient, IServiceHostResolver)

    Initializes and returns an instance of CloudAssetFileManager

    Declaration
    public CloudAssetFileManager(IServiceHttpClient serviceHttpClient, IServiceHostResolver serviceHostResolver)
    Parameters
    Type Name Description
    IServiceHttpClient serviceHttpClient

    The IServiceHttpClient used to fetch the data.

    IServiceHostResolver serviceHostResolver

    The IServiceHostResolver object.

    Methods

    CreateAssetFileAsync(IProject, IAsset, IAssetFileCreation, CancellationToken)

    Implement this method to create an asset file.

    Declaration
    public Task<IAssetFile> CreateAssetFileAsync(IProject project, IAsset asset, IAssetFileCreation assetFileCreation, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAsset asset

    The asset the file will linked to.

    IAssetFileCreation assetFileCreation

    The object containing the information necessary to create an asset file.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<IAssetFile>

    A task with no result.

    Implements
    IAssetFileManager.CreateAssetFileAsync(IProject, IAsset, IAssetFileCreation, CancellationToken)

    DeleteAssetFileAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to delete an asset file.

    Declaration
    public Task DeleteAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.DeleteAssetFileAsync(IProject, IAssetFile, CancellationToken)

    DownloadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    Implement this method to download an asset file.

    Declaration
    public Task DownloadAssetFileAsync(IProject project, IAssetFile assetFile, Stream destinationStream, IProgress<HttpProgress> progress, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream destinationStream

    The destination stream for the file content

    IProgress<HttpProgress> progress

    The progress provider.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task.

    Implements
    IAssetFileManager.DownloadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    FinalizeAssetFileUploadAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to finalize the upload of an asset file.

    Declaration
    public Task FinalizeAssetFileUploadAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.FinalizeAssetFileUploadAsync(IProject, IAssetFile, CancellationToken)

    GetAssetFileUrlAsync(IProject, IAssetFile, AssetFileUrlType, CancellationToken)

    Implement this method to get an asset file url.

    Declaration
    public Task<string> GetAssetFileUrlAsync(IProject project, IAssetFile assetFile, AssetFileUrlType urlType, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    AssetFileUrlType urlType

    The asset file's url type

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<String>

    A task with no result.

    Implements
    IAssetFileManager.GetAssetFileUrlAsync(IProject, IAssetFile, AssetFileUrlType, CancellationToken)

    UpdateAssetFileAsync(IProject, IAssetFile, CancellationToken)

    Implement this method to update an asset file.

    Declaration
    public Task UpdateAssetFileAsync(IProject project, IAssetFile assetFile, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task

    A task with no result.

    Implements
    IAssetFileManager.UpdateAssetFileAsync(IProject, IAssetFile, CancellationToken)

    UploadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    Implement this method to upload an asset file.

    Declaration
    public Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, IProgress<HttpProgress> progress, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream contentStream

    The stream to the file content

    IProgress<HttpProgress> progress

    The progress provider.

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<Boolean>

    A task whose result signals the success of the upload.

    Implements
    IAssetFileManager.UploadAssetFileAsync(IProject, IAssetFile, Stream, IProgress<HttpProgress>, CancellationToken)

    UploadAssetFileAsync(IProject, IAssetFile, Stream, CancellationToken)

    Implement this method to upload an asset file.

    Declaration
    [Obsolete("Use UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, IProgress<HttpProgress> progress, CancellationToken token) instead.")]
    public Task<bool> UploadAssetFileAsync(IProject project, IAssetFile assetFile, Stream contentStream, CancellationToken token)
    Parameters
    Type Name Description
    IProject project

    The project in which the asset resides.

    IAssetFile assetFile

    The asset file

    Stream contentStream

    The stream to the file content

    CancellationToken token

    The cancellation token

    Returns
    Type Description
    Task<Boolean>

    A task whose result signals the success of the upload.

    Implements
    IAssetFileManager.UploadAssetFileAsync(IProject, IAssetFile, Stream, CancellationToken)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023