Class FileSystemHelper
Extends the functionality of FileSystem objects to convert into their Phoenix counterparts
Inheritance
Inherited Members
Namespace: Phoenix.DeviceStorage
Assembly: Phoenix.Abstractions.DeviceStorage.dll
Syntax
public static class FileSystemHelper
Properties
View SourcePhoenixTempPath
Gets the temp files path for Phoenix.
Declaration
public static string PhoenixTempPath { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceGetDirectoryName(String, PhoenixIOType)
Gets the DirectoryName of the PhoenixIOType
Declaration
public static string GetDirectoryName(string path, PhoenixIOType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
PhoenixIOType | type | The type of path. |
Returns
Type | Description |
---|---|
System.String | DirectoryName, null if path is null, root or empty string/white space. |
Remarks
Unless the type is set to WindowsSystem this will not do Path validation, as this method should be used in conjunction with the PhoenixPath (which will validate the path).
GetName(String)
Gets the name of file or directory
Declaration
public static string GetName(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
Returns
Type | Description |
---|---|
System.String | The file/directory name, or null if path is null. |
Remarks
This will not do Path validation, as this method should be used in conjunction with the PhoenixPath (which will validate the path).
GetPathRoot(String, PhoenixIOType)
Gets the path root of a PhoenixIOType
Declaration
public static string GetPathRoot(string path, PhoenixIOType type)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path. |
PhoenixIOType | type | The type of path. |
Returns
Type | Description |
---|---|
System.String | Path root, null if path is empty or no root could be found. |
Remarks
Unless the type is set to WindowsSystem this will not do Path validation, as this method should be used in conjunction with the PhoenixPath (which will validate the path).
GetTempFileName()
Attempts to create a temp file and logs failures if a file can not be created.
Declaration
public static string GetTempFileName()
Returns
Type | Description |
---|---|
System.String | Returns the path to a temp file if created successfully. |
TryDeleteFile(String)
Tries to delete a file.
Declaration
public static bool TryDeleteFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | The path to the file to delete. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the file is successfully deleted. Otherwise false. |
TryDeletePhoenixTempDirectory()
Tries to delete the temp file directory for Phoenix.
Declaration
public static bool TryDeletePhoenixTempDirectory()
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the delete was successful. Otherwise false. |