Back to API Reference
Class

FileDocumentSource

sealed

A file addressed as a root folder plus a relative path. Roots the platform exposes as folders load synchronously through FileTextSource; roots that are URLs (streaming assets on Android and on the web) download and deliver later, which needs the built-in Unity Web Request module — without it a URL location fails to load.

public DocumentPathRoot Root{ get; set }
public string Path{ get; set }
public TextFileEncoding Encoding{ get; set }
public FileTextBackend Backend{ get; set }
public bool IsEmpty{ get }
public string ResolvedLocation{ get }

The full path or URL the source resolves to on this platform; empty without a path, since a root alone names no file.

public bool IsRemote{ get }

True when the resolved location is a URL, so the load is asynchronous.

public static string RootLocation()

The root's folder or URL on this platform; empty for Absolute.

public static bool IsUrl()

True when location is a URL rather than a file system path.

public override IDisposable Load()