Table of Contents

Class FileUtility

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

File Utilities methods.

public class FileUtility
Inheritance
FileUtility

Methods

EnumerateDirectories(string, SearchDirection)

public static IEnumerable<DirectoryInfo> EnumerateDirectories(string rootDirectory, SearchDirection direction)

Parameters

rootDirectory string
direction SearchDirection

Returns

IEnumerable<DirectoryInfo>

GetAbsolutePath(string)

Converts a relative path to an absolute path using the current working directoy.

public static string GetAbsolutePath(string filePath)

Parameters

filePath string

The file path.

Returns

string

An absolute path.

GetFileExtensions(string)

Gets the file extensions normalized separated by ',' ';'.

public static string[] GetFileExtensions(string fileExtensions)

Parameters

fileExtensions string

The file extensions separated by ',' ';'.

Returns

string[]

An array of file extensions.

GetFileExtensionsAsSet(string)

Gets the file extensions normalized separated by ',' ';'.

public static HashSet<string> GetFileExtensionsAsSet(string fileExtensions)

Parameters

fileExtensions string

The file extensions separated by ',' ';'.

Returns

HashSet<string>

An array of file extensions.

IsFileLocked(FileInfo)

Determines whether the specified file is locked.

public static bool IsFileLocked(FileInfo file)

Parameters

file FileInfo

The file.

Returns

bool

true if the specified file is locked; otherwise, false.

Exceptions

ArgumentNullException

file is null

IsFileLocked(string)

Determines whether the specified file is locked.

public static bool IsFileLocked(string filePath)

Parameters

filePath string

The file path.

Returns

bool

true if the specified file is locked; otherwise, false.

Exceptions

ArgumentNullException

filePath is null

NormalizeFileExtension(string)

Normalizes the file extension by adding a '.' prefix and making it lowercase.

public static string NormalizeFileExtension(string fileExtension)

Parameters

fileExtension string

The file extension.

Returns

string

A normalized file extension.