Class CloudAssetFileManager
A class that implements IAssetFileManager to provide asset file controller functionality.
Asset Manager Consumer
role.
Inherited Members
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
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
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
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
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
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
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
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. |