Show / Hide Table of Contents

    Class FileSystemExtensions

    Extensions for the file system stuff.

    Inheritance
    Object
    FileSystemExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: FubarDev.FtpServer.FileSystem
    Assembly: FubarDev.FtpServer.Abstractions.dll
    Syntax
    public static class FileSystemExtensions

    Methods

    | Improve this Doc View Source

    Clone(Stack<IUnixDirectoryEntry>)

    Clone the stack of directory entries.

    Declaration
    public static Stack<IUnixDirectoryEntry> Clone(this Stack<IUnixDirectoryEntry> path)
    Parameters
    Type Name Description
    Stack<IUnixDirectoryEntry> path

    The stack of directory entries to clone.

    Returns
    Type Description
    Stack<IUnixDirectoryEntry>

    the cloned path.

    | Improve this Doc View Source

    CombinePath(Nullable<String>, IEnumerable<String>)

    Appends parts to a path.

    Declaration
    public static string CombinePath(string? path, IEnumerable<string> parts)
    Parameters
    Type Name Description
    Nullable<String> path

    The path to append to.

    IEnumerable<String> parts

    The parts to append.

    Returns
    Type Description
    String

    The combined path.

    | Improve this Doc View Source

    CombinePath(Nullable<String>, String[])

    Appends parts to a path.

    Declaration
    public static string CombinePath(string? path, params string[] parts)
    Parameters
    Type Name Description
    Nullable<String> path

    The path to append to.

    String[] parts

    The parts to append.

    Returns
    Type Description
    String

    The combined path.

    | Improve this Doc View Source

    GetDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)

    Get the directory for the given pathElements.

    Declaration
    public static Task<IUnixDirectoryEntry? > GetDirectoryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, IReadOnlyList<string> pathElements, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The file system to get the directory for.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    IReadOnlyList<String> pathElements

    The (absolute or relative) path to get the directory for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IUnixDirectoryEntry>>

    The found IUnixDirectoryEntry or null.

    | Improve this Doc View Source

    GetDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)

    Get the directory for the given path.

    Declaration
    public static Task<IUnixDirectoryEntry? > GetDirectoryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, string? path, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The file system to get the directory for.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    Nullable<String> path

    The (absolute or relative) path to get the directory for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<IUnixDirectoryEntry>>

    The found IUnixDirectoryEntry or null.

    | Improve this Doc View Source

    GetFullPath(IEnumerable<IUnixDirectoryEntry>)

    Returns the path as string.

    Declaration
    public static string GetFullPath(this IEnumerable<IUnixDirectoryEntry> path)
    Parameters
    Type Name Description
    IEnumerable<IUnixDirectoryEntry> path

    The path to convert to string.

    Returns
    Type Description
    String

    The path as string.

    | Improve this Doc View Source

    GetFullPath(Stack<IUnixDirectoryEntry>)

    Returns the path as string.

    Declaration
    public static string GetFullPath(this Stack<IUnixDirectoryEntry> path)
    Parameters
    Type Name Description
    Stack<IUnixDirectoryEntry> path

    The path to convert to string.

    Returns
    Type Description
    String

    The path as string.

    | Improve this Doc View Source

    GetFullPath(Stack<IUnixDirectoryEntry>, Nullable<String>)

    Returns the path as string.

    Declaration
    public static string GetFullPath(this Stack<IUnixDirectoryEntry> path, string? fileName)
    Parameters
    Type Name Description
    Stack<IUnixDirectoryEntry> path

    The path to convert to string.

    Nullable<String> fileName

    The file name to append to the path.

    Returns
    Type Description
    String

    The combination of path and fileName as string.

    | Improve this Doc View Source

    GetParentPath(String)

    Returns the parent path of the path.

    Declaration
    public static string GetParentPath(this string path)
    Parameters
    Type Name Description
    String path

    The path to get the parent path from.

    Returns
    Type Description
    String

    The parent path.

    | Improve this Doc View Source

    IsChildOfOrSameAs(Stack<IUnixDirectoryEntry>, Stack<IUnixDirectoryEntry>, IUnixFileSystem)

    Determines whether the pathToTestAsChild is a child or the same path as pathToTestAsParent.

    Declaration
    public static bool IsChildOfOrSameAs(this Stack<IUnixDirectoryEntry> pathToTestAsChild, Stack<IUnixDirectoryEntry> pathToTestAsParent, IUnixFileSystem fileSystem)
    Parameters
    Type Name Description
    Stack<IUnixDirectoryEntry> pathToTestAsChild

    The path to test as child.

    Stack<IUnixDirectoryEntry> pathToTestAsParent

    The path to test as parent.

    IUnixFileSystem fileSystem

    The file system to use to compare the file names.

    Returns
    Type Description
    Boolean
    true
    if the pathToTestAsChild is a child or the same path as pathToTestAsParent.
    | Improve this Doc View Source

    SearchDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)

    Searches for a IUnixDirectoryEntry by using the currentPath and pathElements.

    Declaration
    public static Task<SearchResult<IUnixDirectoryEntry>? > SearchDirectoryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, IReadOnlyList<string> pathElements, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    IReadOnlyList<String> pathElements

    The relative path elements to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixDirectoryEntry>>>

    The found IUnixDirectoryEntry.

    | Improve this Doc View Source

    SearchDirectoryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)

    Searches for a IUnixDirectoryEntry by using the currentPath and path.

    Declaration
    public static Task<SearchResult<IUnixDirectoryEntry>? > SearchDirectoryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, string? path, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    Nullable<String> path

    The relative path to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixDirectoryEntry>>>

    The found IUnixDirectoryEntry.

    | Improve this Doc View Source

    SearchEntryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)

    Searches for a IUnixFileSystemEntry by using the currentPath and pathElements.

    Declaration
    public static Task<SearchResult<IUnixFileSystemEntry>? > SearchEntryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, IReadOnlyList<string> pathElements, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    IReadOnlyList<String> pathElements

    The relative path elements to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixFileSystemEntry>>>

    The found IUnixFileSystemEntry.

    | Improve this Doc View Source

    SearchEntryAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)

    Searches for a IUnixFileSystemEntry by using the currentPath and path.

    Declaration
    public static Task<SearchResult<IUnixFileSystemEntry>? > SearchEntryAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, string? path, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    Nullable<String> path

    The relative path to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixFileSystemEntry>>>

    The found IUnixFileSystemEntry.

    | Improve this Doc View Source

    SearchFileAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, IReadOnlyList<String>, CancellationToken)

    Searches for a IUnixFileEntry by using the currentPath and pathElements.

    Declaration
    public static Task<SearchResult<IUnixFileEntry>? > SearchFileAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, IReadOnlyList<string> pathElements, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    IReadOnlyList<String> pathElements

    The relative path elements to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixFileEntry>>>

    The found IUnixDirectoryEntry.

    | Improve this Doc View Source

    SearchFileAsync(IUnixFileSystem, Stack<IUnixDirectoryEntry>, Nullable<String>, CancellationToken)

    Searches for a IUnixFileEntry by using the currentPath and path.

    Declaration
    public static Task<SearchResult<IUnixFileEntry>? > SearchFileAsync(this IUnixFileSystem fileSystem, Stack<IUnixDirectoryEntry> currentPath, string? path, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    IUnixFileSystem fileSystem

    The underlying IUnixFileSystem.

    Stack<IUnixDirectoryEntry> currentPath

    The current path.

    Nullable<String> path

    The relative path to search for.

    CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    Task<Nullable<SearchResult<IUnixFileEntry>>>

    The found IUnixDirectoryEntry.

    | Improve this Doc View Source

    SplitPath(Nullable<String>)

    Split the path into parts.

    Declaration
    public static IReadOnlyList<string> SplitPath(string? path)
    Parameters
    Type Name Description
    Nullable<String> path

    The path to split.

    Returns
    Type Description
    IReadOnlyList<String>

    The parts of the path.

    | Improve this Doc View Source

    ToDisplayString(Stack<IUnixDirectoryEntry>)

    Returns the path as string like GetFullPath(Stack<IUnixDirectoryEntry>), with the difference that it doesn't add the trailing /.

    Declaration
    public static string ToDisplayString(this Stack<IUnixDirectoryEntry> path)
    Parameters
    Type Name Description
    Stack<IUnixDirectoryEntry> path

    The path to convert to string.

    Returns
    Type Description
    String

    The path as string.

    • Improve this Doc
    • View Source
    Back to top
    Copyright © 2018 Fubar Development Junker
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.