Class FileUtils
Utility class to process file paths.
Inherited Members
Namespace: Oci.Common.Utils
Assembly: OCI.DotNetSDK.Common.dll
Syntax
public class FileUtils
Methods
CorrectPath(PlatformID, string)
Fixes the file path separator for current OS.
https://docs.microsoft.com/en-us/dotnet/api/system.platformid?view=netframework-4.8
PlatformID is an enum. There are values that are no longer in use. So we are only detecting Wind32NT.
Otherwise we assume it is either Unix or MacOSX.
Declaration
public static string CorrectPath(PlatformID platformID, string path)
Parameters
Type | Name | Description |
---|---|---|
PlatformID | platformID | The platform id containing OS information. |
string | path | The file path to be processed. |
Returns
Type | Description |
---|---|
string | The file path with correct file separator for current OS. |
ExpandUserHome(string)
Expands user home path in file path.
Declaration
public static string ExpandUserHome(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The file path to be processed. |
Returns
Type | Description |
---|---|
string | The expanded file path with home symbol (~) being replaced by full user home path. |
GetSecurePassphraseFromFile(string)
Declaration
public static SecureString GetSecurePassphraseFromFile(string passphrasePath)
Parameters
Type | Name | Description |
---|---|---|
string | passphrasePath |
Returns
Type | Description |
---|---|
SecureString |