Class FileHandler
Handle in charge of exposing the file functionalities, such as loading, saving, copying and deleting.
Inherited Members
Namespace: Appearition
Assembly: Appearition.SDK.dll
Syntax
public class FileHandler : BaseHandler
Methods
CopyExistingFileToDestination(String, String, Action<Boolean>)
Copies a local file at a given path to a destination at a given path.
Declaration
public static void CopyExistingFileToDestination(string pathToSourceFile, string pathToDestinationFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToSourceFile | The full path to the original file, including filename and extension. |
System.String | pathToDestinationFile | The full path to the destination file location, including filename and extension. |
System.Action<System.Boolean> | onComplete | Called once the process is complete. Includes whether or not the action was successful. |
CopyExistingFileToDestinationProcess(String, String, Action<Boolean>)
Copies a local file at a given path to a destination at a given path.
Declaration
public static IEnumerator CopyExistingFileToDestinationProcess(string pathToSourceFile, string pathToDestinationFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToSourceFile | The full path to the original file, including filename and extension. |
System.String | pathToDestinationFile | The full path to the destination file location, including filename and extension. |
System.Action<System.Boolean> | onComplete | Called once the process is complete. Includes whether or not the action was successful. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
DeleteExistingFile(String, Action<Boolean>)
Deletes the file at a given location.
Declaration
public static void DeleteExistingFile(string pathToFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToFile | The full path to the file, including filename and extension. |
System.Action<System.Boolean> | onComplete | Called once the process is complete. Includes whether or not the action was successful. |
DeleteExistingFileProcess(String, Action<Boolean>)
Deletes the file at a given location.
Declaration
public static IEnumerator DeleteExistingFileProcess(string pathToFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToFile | The full path to the file, including filename and extension. |
System.Action<System.Boolean> | onComplete | Called once the process is complete. Includes whether or not the action was successful. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
LoadBytesFromFile(String, Action<Byte[]>)
Fetches the content of a local file at a given path.
Declaration
public static void LoadBytesFromFile(string pathToFile, Action<byte[]> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToFile | Full path to the file to load. |
System.Action<System.Byte[]> | onComplete | Called once the file loading process has completed. Contains the file content. |
LoadBytesFromFileProcess(String, Action<Byte[]>)
Fetches the content of a local file at a given path.
Declaration
public static IEnumerator LoadBytesFromFileProcess(string pathToFile, Action<byte[]> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToFile | Full path to the file to load. |
System.Action<System.Byte[]> | onComplete | Called once the file loading process has completed. Contains the file content. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
SaveBytesToFile(Byte[], String, Action<Boolean>)
Declaration
public static void SaveBytesToFile(byte[] data, string pathToFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
System.String | pathToFile | |
System.Action<System.Boolean> | onComplete |
SaveBytesToFileProcess(Byte[], String, Action<Boolean>)
Saves given content to a file at a given full path.
Declaration
public static IEnumerator SaveBytesToFileProcess(byte[] data, string pathToFile, Action<bool> onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | The content that the file should contain. |
System.String | pathToFile | The full path to the file, including filename and extension. |
System.Action<System.Boolean> | onComplete | Called once the process is complete. Includes whether or not the action was successful. |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |