Table of Contents

Class FileUtilities

Namespace
HomaGames.HomaBelly
Assembly
HomaGames.HomaBelly.Core.dll
[Obsolete("Use Homa.Sdk.Foundation.DefaultFileSystem instead.")]
public static class FileUtilities
Inheritance
FileUtilities
Inherited Members

Methods

CreateIntermediateDirectoriesIfNecessary(string)

Create a parent directory of provided file path if it doesn't exist

[Obsolete("Use System.IO.Directory.CreateDirectory instead.")]
public static bool CreateIntermediateDirectoriesIfNecessary(string filePath)

Parameters

filePath string

Returns

bool

Was directory created

LoadAndDeserializeJsonFromPersistentPath<T>(string, bool)

public static Task<T> LoadAndDeserializeJsonFromPersistentPath<T>(string filePath, bool showErrorIfFileDontExist = true)

Parameters

filePath string
showErrorIfFileDontExist bool

Returns

Task<T>

Type Parameters

T

LoadAndDeserializeJsonFromResources<T>(string, bool)

Async method to load and deserialize a text file in a Resources folder.

public static Task<T> LoadAndDeserializeJsonFromResources<T>(string filePath, bool showErrorIfFileDontExist = true)

Parameters

filePath string

A text file in a Resources folder

showErrorIfFileDontExist bool

Whether or not to log an error if the file does not exist

Returns

Task<T>

The deserialized object or null of something goes wrong.

Type Parameters

T

Type to deserialize the json

ReadAllText(string)

[Obsolete("This method will be removed in future versions. Use LoadAndDeserializeJsonFromResources instead")]
public static string ReadAllText(string filePath)

Parameters

filePath string

Returns

string