Class FtpResponseList<TStatus>
Base class for FTP response lists.
Implements
Inherited Members
Namespace: FubarDev.FtpServer
Assembly: FubarDev.FtpServer.Abstractions.dll
Syntax
public abstract class FtpResponseList<TStatus> : IFtpResponse where TStatus : class
Type Parameters
| Name | Description |
|---|---|
| TStatus | The type of the status used to get the lines. |
Constructors
| Improve this Doc View SourceFtpResponseList(Int32, String, String)
Initializes a new instance of the FtpResponseList<TStatus> class.
Declaration
protected FtpResponseList(int code, string startMessage, string endMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | code | The status code. |
| String | startMessage | The message in the start line. |
| String | endMessage | The message in the end line. |
Properties
| Improve this Doc View SourceAfterWriteAction
Gets the async action to execute after sending the response to the client.
Declaration
[Obsolete("Use a custom server command.")]
public FtpResponseAfterWriteAsyncDelegate? AfterWriteAction { get; }
Property Value
| Type | Description |
|---|---|
| Nullable<FtpResponseAfterWriteAsyncDelegate> |
Code
Declaration
public int Code { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
EndMessage
Gets the message for the last line.
Declaration
public string EndMessage { get; }
Property Value
| Type | Description |
|---|---|
| String |
StartMessage
Gets the message for the first line.
Declaration
public string StartMessage { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
| Improve this Doc View SourceCreateInitialStatusAsync(CancellationToken)
Creates the initial status.
Declaration
protected abstract Task<TStatus> CreateInitialStatusAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<TStatus> | The task containing the initial status. |
GetNextLineAsync(TStatus, CancellationToken)
Gets the next line according to the given status.
Declaration
protected abstract Task<string? > GetNextLineAsync(TStatus status, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| TStatus | status | The status used to get the next line. |
| CancellationToken | cancellationToken | The cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<Nullable<String>> | The task containing the next line or null if there are no more lines. |
GetNextLineAsync(Nullable<Object>, CancellationToken)
Declaration
public Task<FtpResponseLine> GetNextLineAsync(object? token, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| Nullable<Object> | token | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<FtpResponseLine> |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |