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
filePathstring
Returns
- bool
Was directory created
LoadAndDeserializeJsonFromPersistentPath<T>(string, bool)
public static Task<T> LoadAndDeserializeJsonFromPersistentPath<T>(string filePath, bool showErrorIfFileDontExist = true)
Parameters
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
filePathstringA text file in a Resources folder
showErrorIfFileDontExistboolWhether 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
TType 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
filePathstring