FtpSession class

Constructors

FtpSession(Socket _controlSocket, {String? username, String? password, required FileOperations fileOperations, required ServerType serverType, required LoggerHandler logger, SecurityContext? securityContext, FtpSecurityMode securityMode = FtpSecurityMode.none, bool requireEncryptedData = false, bool tlsActive = false, void onDisconnect()?})

Properties

cachedUsername String?
getter/setter pair
commandHandler FTPCommandHandler
final
controlSocket Socket
no setter
dataListener ServerSocket?
getter/setter pair
dataSocket Socket?
getter/setter pair
epsvAllMode bool
RFC 2428: after EPSV ALL, PORT/PASV/LPRT must be refused.
getter/setter pair
fileOperations FileOperations
final
hashCode int
The hash code for this object.
no setterinherited
isAuthenticated bool
getter/setter pair
logger LoggerHandler
final
onDisconnect ↔ void Function()?
Callback invoked when this session's connection is closed. Used by FtpServer to remove the session from its active list.
getter/setter pair
password String?
final
pbszReceived bool
Whether PBSZ has been received (gate for PROT).
getter/setter pair
pendingRenameFrom String?
getter/setter pair
protectionLevel ProtectionLevel
Data channel protection level.
getter/setter pair
requireEncryptedData bool
Whether the server requires encrypted data connections.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
securityContext SecurityContext?
SecurityContext for upgrading sockets (control and data).
final
securityMode FtpSecurityMode
The security mode for this session.
final
serverType ServerType
final
tlsActive bool
Whether the control connection is TLS-encrypted.
getter/setter pair
transferInProgress bool
getter/setter pair
username String?
final

Methods

abortTransfer() → void
changeDirectory(String dirname) → void
changeToParentDirectory() → void
checkDataProtection() bool
Check whether a data transfer is allowed given the current PROT setting. Returns true if allowed, false if denied (and sends 521 response).
closeConnection() → void
deleteFile(String filePath) Future<void>
enterActiveMode(String parameters) Future<void>
enterExtendedPassiveMode() Future<void>
enterPassiveMode() Future<void>
fileSize(String filePath) Future<void>
handleMdtm(String argument) → void
handleMlsd(String argument) Future<void>
listDirectory(String path) Future<void>
listDirectoryNames(String path) Future<void>
NLST: list only filenames, one per line (RFC 959).
makeDirectory(String dirname) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openDataConnection() Future<bool>
processCommand(List<int> data) → void
reinitialize() → void
Reinitialize the session to its initial state (RFC 959 REIN). Resets authentication, transfer parameters, data connections, and working directory. If a transfer is in progress, data connections are left open until the transfer completes naturally.
removeDirectory(String dirname) Future<void>
renameFileOrDirectory(String oldPath, String newPath) Future<void>
retrieveFile(String filename) Future<void>
sendResponse(String message) → void
statPath(String path) Future<void>
STAT with pathname: list file/directory info over the control connection (RFC 959 §4.1.3). Uses 213 for status replies sent over control.
storeFile(String filename) Future<void>
toString() String
A string representation of this object.
inherited
upgradeToTls() Future<void>
Upgrade the control connection to TLS using SecureSocket.secureServer(). Re-attaches the command listener on the new secure socket.
waitForClientDataSocket({Duration? timeout}) Future<void>

Operators

operator ==(Object other) bool
The equality operator.
inherited