docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class FileDownloadItem

    IDownloadItem implementation for downloading to a file specified by path.

    Inheritance
    object
    FileDownloadItem
    Implements
    IDownloadItem
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Build.CacheServer
    Assembly: UnityEditor.CacheServer.dll
    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

    Type

    The type of the FileDownloadItems desired item.

    Declaration
    public FileType Type { get; }
    Property Value
    Type Description
    FileType

    Methods

    Finish()

    Dispose the FileDownloadItems write stream and move the data from the temporary path to its final destination.

    Declaration
    public void Finish()

    GetWriteStream(long)

    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
    long size
    Returns
    Type Description
    Stream

    Implements

    IDownloadItem
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)