Search Results for

    Class AMNetScpFileOpener

    Default .NET-facing SCP filesystem policy hook. Override this class to implement application-specific SCP path, stream, and permission behavior without using Apache MINA or Java types in application code.

    Inheritance
    object
    AMNetScpFileOpener
    Implements
    IAMNetScpFileOpener
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ApacheMinaSSHD.NET.Wrapper.Abstractions
    Assembly: ApacheMinaSSHD.NET.Wrapper.dll
    Syntax
    public class AMNetScpFileOpener : IAMNetScpFileOpener

    Constructors

    | Edit this page View Source

    AMNetScpFileOpener(string?)

    Creates a default SCP policy hook.

    Declaration
    public AMNetScpFileOpener(string? rootPath = null)
    Parameters
    Type Name Description
    string rootPath

    Optional root path used by the default path allow-list behavior.

    Properties

    | Edit this page View Source

    HiddenNames

    File or directory names (case-insensitive) that should be hidden by the default policy.

    Declaration
    protected virtual IReadOnlySet<string> HiddenNames { get; }
    Property Value
    Type Description
    IReadOnlySet<string>
    | Edit this page View Source

    RootPath

    Gets the optional local root path used by the default path allow-list behavior.

    Declaration
    public string? RootPath { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    CloseRead(ISshScpFileAccess)

    Called after a local file read/send handle is closed.

    Declaration
    public virtual void CloseRead(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    CloseWrite(ISshScpFileAccess)

    Called after a local file write/receive handle is closed.

    Declaration
    public virtual void CloseWrite(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    CreateSourceStreamResolver(ISshScpFileAccess)

    Called when the server creates an outgoing SCP source stream resolver.

    Declaration
    public virtual void CreateSourceStreamResolver(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    CreateTargetStreamResolver(ISshScpFileAccess)

    Called when the server creates an incoming SCP target stream resolver.

    Declaration
    public virtual void CreateTargetStreamResolver(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    GetLocalFilePermissions(ISshScpFileAccess, IReadOnlyList<string>)

    Allows the application to filter or rewrite local file permissions reported to SCP clients.

    Declaration
    public virtual IReadOnlyList<string> GetLocalFilePermissions(ISshScpFileAccess access, IReadOnlyList<string> permissions)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    IReadOnlyList<string> permissions

    The default permission names.

    Returns
    Type Description
    IReadOnlyList<string>

    The permission names to use.

    | Edit this page View Source

    GetMatchingFilesToSend(ISshScpFileAccess, IReadOnlyList<string>)

    Filters or rewrites files that match an outgoing SCP pattern.

    Declaration
    public virtual IReadOnlyList<string> GetMatchingFilesToSend(ISshScpFileAccess access, IReadOnlyList<string> resolvedPaths)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    IReadOnlyList<string> resolvedPaths

    The default matching local paths.

    Returns
    Type Description
    IReadOnlyList<string>

    The local paths that may be sent.

    | Edit this page View Source

    IsPathAllowed(ISshScpFileAccess)

    Returns whether the requested SCP path or operation is allowed.

    Declaration
    public virtual bool IsPathAllowed(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    Returns
    Type Description
    bool

    true to allow the operation; otherwise false.

    | Edit this page View Source

    OpenRead(ISshScpFileAccess)

    Called before a local file is opened for SCP read/send.

    Declaration
    public virtual void OpenRead(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    OpenWrite(ISshScpFileAccess)

    Called before a local file is opened for SCP write/receive.

    Declaration
    public virtual void OpenWrite(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    | Edit this page View Source

    ReadLocalBasicFileAttributes(ISshScpFileAccess, IReadOnlyDictionary<string, object>)

    Allows the application to filter or rewrite file attributes reported to SCP clients.

    Declaration
    public virtual IReadOnlyDictionary<string, object> ReadLocalBasicFileAttributes(ISshScpFileAccess access, IReadOnlyDictionary<string, object> attributes)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    IReadOnlyDictionary<string, object> attributes

    The default attributes.

    Returns
    Type Description
    IReadOnlyDictionary<string, object>

    The attributes to use.

    | Edit this page View Source

    ResolveIncomingFilePath(ISshScpFileAccess, string)

    Allows the application to rewrite the destination path for an incoming file.

    Declaration
    public virtual string ResolveIncomingFilePath(ISshScpFileAccess access, string resolvedPath)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    string resolvedPath

    The default resolved path.

    Returns
    Type Description
    string

    The local path to use for the incoming file.

    | Edit this page View Source

    ResolveIncomingReceiveLocation(ISshScpFileAccess, string)

    Allows the application to rewrite the receive location for incoming SCP data.

    Declaration
    public virtual string ResolveIncomingReceiveLocation(ISshScpFileAccess access, string resolvedPath)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    string resolvedPath

    The default resolved path.

    Returns
    Type Description
    string

    The local receive location to use.

    | Edit this page View Source

    ResolveLocalPath(ISshScpFileAccess, string)

    Allows the application to rewrite a client path into a local path.

    Declaration
    public virtual string ResolveLocalPath(ISshScpFileAccess access, string resolvedPath)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    string resolvedPath

    The default resolved path.

    Returns
    Type Description
    string

    The local path to use.

    | Edit this page View Source

    ResolveOutgoingFilePath(ISshScpFileAccess, string)

    Allows the application to rewrite the source path for an outgoing file.

    Declaration
    public virtual string ResolveOutgoingFilePath(ISshScpFileAccess access, string resolvedPath)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    string resolvedPath

    The default resolved path.

    Returns
    Type Description
    string

    The local path to send.

    | Edit this page View Source

    ShouldIncludeDirectoryEntry(ISshScpFileAccess)

    Returns whether a directory entry should be visible during recursive SCP.

    Declaration
    public virtual bool ShouldIncludeDirectoryEntry(ISshScpFileAccess access)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    Returns
    Type Description
    bool

    true to include the entry; otherwise false.

    | Edit this page View Source

    ShouldSendAsDirectory(ISshScpFileAccess, bool)

    Returns whether the path should be sent as a directory.

    Declaration
    public virtual bool ShouldSendAsDirectory(ISshScpFileAccess access, bool defaultValue)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    bool defaultValue

    The default server decision.

    Returns
    Type Description
    bool

    The decision to use.

    | Edit this page View Source

    ShouldSendAsRegularFile(ISshScpFileAccess, bool)

    Returns whether the path should be sent as a regular file.

    Declaration
    public virtual bool ShouldSendAsRegularFile(ISshScpFileAccess access, bool defaultValue)
    Parameters
    Type Name Description
    ISshScpFileAccess access

    Operation metadata for the SCP request.

    bool defaultValue

    The default server decision.

    Returns
    Type Description
    bool

    The decision to use.

    Implements

    IAMNetScpFileOpener
    • Edit this page
    • View Source
    In this article
    Back to top Porta SFTP ServerGitHubApacheMinaSSHD.NET Generated by DocFX