Class FileDownloadItem
IDownloadItem implementation for downloading to a file specified by path.
Namespace: UnityEditor.Build.CacheServer
Syntax
public class FileDownloadItem : IDownloadItem
Constructors
FileDownloadItem(FileId, FileType, String)
Create a new FileDownloadItem
Declaration
public FileDownloadItem(FileId fileId, FileType fileType, string path)
Parameters
Type | Name | Description |
---|---|---|
FileId | fileId | The FileId of the desired item. |
FileType | fileType | The FileType of the desired item. |
String | path | The path of the desired item. |
Properties
FilePath
File path where downloaded file data is saved. Data is first written to a temporary file location, and moved into place when the Finish() method is called by the Cache Server Client.
Declaration
public string FilePath { get; }
Property Value
Type | Description |
---|---|
String |
Id
The FileId for the FileDownloadItem. FileId consists of an assets guid and hash code.
Declaration
public FileId Id { get; }
Property Value
Type | Description |
---|---|
FileId |
Implements
Type
The type of the FileDownloadItems desired item.
Declaration
public FileType Type { get; }
Property Value
Type | Description |
---|---|
FileType |
Implements
Methods
Finish()
Dispose the FileDownloadItems write stream and move the data from the temporary path to its final destination.
Declaration
public void Finish()
Implements
GetWriteStream(Int64)
Gets the write stream for a given FileDownloadItem. If one does not exist, it will be created.
Declaration
public Stream GetWriteStream(long size)
Parameters
Type | Name | Description |
---|---|---|
Int64 | size |
Returns
Type | Description |
---|---|
Stream |