Class SftpProducer
SFTP producer. Uploads exchange body to a remote file on the SFTP server.
Supports atomic upload via temp files (TempPrefix/TempFileName → rename),
multiple file-exist strategies, dynamic file names via expressions, chmod,
automatic directory creation, and jail-path validation.
public sealed class SftpProducer : RemoteFileProducer<SftpEndpointOptions>, IProducer, IProcessor
Inheritance
Implements
Properties
FileNameProducedHeader
Header name for the produced file path (e.g. "redbFile.NameProduced").
protected override string FileNameProducedHeader { get; }
Methods
AfterWriteAsync(IExchange, string, CancellationToken)
Called after a successful write. Override for chmod, keepLastModified, content-type inference.
protected override Task AfterWriteAsync(IExchange exchange, string targetPath, CancellationToken ct)
BeforeWriteAsync(string, CancellationToken)
Connects to the remote server and auto-creates the target directory if configured.
protected override Task BeforeWriteAsync(string targetDir, CancellationToken ct)
MoveExistingFile(string, CancellationToken)
Moves an existing file at the target path to a backup name.
protected override Task MoveExistingFile(string path, CancellationToken ct)
ResolveTargetPath(IExchange)
Resolves the target file path from the FileName option or exchange headers.
protected override string ResolveTargetPath(IExchange exchange)
ValidatePath(string)
Validates the target path before writing. Override for jail-directory checks.
protected override void ValidatePath(string targetPath)