Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    FileUtility Class

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

    File Utilities methods.

    System.Object → FileUtility
    Derived from FileUtility:

    public class FileUtility
    Name Description
    Methods
    EnumerateDirectories(String, SearchDirection)
    GetAbsolutePath(String)

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

    GetFileExtensions(String)

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

    GetFileExtensionsAsSet(String)

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

    IsFileLocked(FileInfo)

    Determines whether the specified file is locked.

    IsFileLocked(String)

    Determines whether the specified file is locked.

    NormalizeFileExtension(String)

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

    | Improve this Doc View Source

    Methods


    EnumerateDirectories(String, SearchDirection)

    public static IEnumerable<DirectoryInfo> EnumerateDirectories(string rootDirectory, SearchDirection direction)
    Parameters
    Type Name Description
    System.String rootDirectory
    SearchDirection direction
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo>

    GetAbsolutePath(String)

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

    public static string GetAbsolutePath(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path.

    Returns
    Type Description
    System.String

    An absolute path.


    GetFileExtensions(String)

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

    public static string[] GetFileExtensions(string fileExtensions)
    Parameters
    Type Name Description
    System.String fileExtensions

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

    Returns
    Type Description
    System.String[]

    An array of file extensions.


    GetFileExtensionsAsSet(String)

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

    public static HashSet<string> GetFileExtensionsAsSet(string fileExtensions)
    Parameters
    Type Name Description
    System.String fileExtensions

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

    Returns
    Type Description
    System.Collections.Generic.HashSet<System.String>

    An array of file extensions.


    IsFileLocked(FileInfo)

    Determines whether the specified file is locked.

    public static bool IsFileLocked(FileInfo file)
    Parameters
    Type Name Description
    System.IO.FileInfo file

    The file.

    Returns
    Type Description
    System.Boolean

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

    Exceptions
    Type Condition
    System.ArgumentNullException

    file is null


    IsFileLocked(String)

    Determines whether the specified file is locked.

    public static bool IsFileLocked(string filePath)
    Parameters
    Type Name Description
    System.String filePath

    The file path.

    Returns
    Type Description
    System.Boolean

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

    Exceptions
    Type Condition
    System.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
    Type Name Description
    System.String fileExtension

    The file extension.

    Returns
    Type Description
    System.String

    A normalized file extension.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation