public class DefaultFtpSession extends Object implements FtpSession
| Constructor and Description |
|---|
DefaultFtpSession(FtpIoSession ioSession)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name)
Get attribute
|
InetSocketAddress |
getClientAddress()
Get remote address
|
Certificate[] |
getClientCertificates()
Retrieve the certificates for the client, if running over SSL and with client authentication
|
Date |
getConnectionTime()
Get connection time.
|
DataConnectionFactory |
getDataConnection()
Get FTP data connection.
|
DataType |
getDataType()
Get the data type.
|
int |
getFailedLogins()
Get the number of failed logins.
|
long |
getFileOffset()
Get file offset.
|
FileSystemView |
getFileSystemView()
Get file system view.
|
String |
getLanguage()
Get language.
|
Date |
getLastAccessTime()
Get last access time.
|
Date |
getLoginTime()
Get the login time.
|
int |
getMaxIdleTime()
Returns maximum idle time.
|
FtpFile |
getRenameFrom()
Get rename from file object.
|
InetSocketAddress |
getServerAddress()
Returns the IP address of the server
|
UUID |
getSessionId()
Get the unique ID for this session.
|
Structure |
getStructure()
Get structure.
|
User |
getUser()
Get user.
|
String |
getUserArgument()
Returns user name entered in USER command
|
void |
increaseReadDataBytes(int increment)
Increase the number of bytes read on the data connection
|
void |
increaseWrittenDataBytes(int increment)
Increase the number of bytes written on the data connection
|
boolean |
isLoggedIn()
Is logged-in
|
boolean |
isSecure()
Indicates whether the control socket for this session is secure, that is,
running over SSL/TLS
|
void |
removeAttribute(String name)
Removes an attribute from this request.
|
void |
setAttribute(String name,
Object value)
Set attribute.
|
void |
setMaxIdleTime(int maxIdleTime)
Set maximum idle time in seconds.
|
void |
write(FtpReply reply)
Write a reply to the client
|
public DefaultFtpSession(FtpIoSession ioSession)
public boolean isLoggedIn()
isLoggedIn in interface FtpSessionpublic DataConnectionFactory getDataConnection()
getDataConnection in interface FtpSessionDataConnectionFactorypublic FileSystemView getFileSystemView()
getFileSystemView in interface FtpSessionFileSystemView for this session/userpublic Date getConnectionTime()
getConnectionTime in interface FtpSessionpublic Date getLoginTime()
getLoginTime in interface FtpSessionpublic Date getLastAccessTime()
getLastAccessTime in interface FtpSessionpublic long getFileOffset()
getFileOffset in interface FtpSessionpublic FtpFile getRenameFrom()
getRenameFrom in interface FtpSessionpublic String getUserArgument()
getUserArgument in interface FtpSessionpublic String getLanguage()
getLanguage in interface FtpSessionpublic User getUser()
getUser in interface FtpSessionUserpublic InetSocketAddress getClientAddress()
getClientAddress in interface FtpSessionInetAddresspublic Object getAttribute(String name)
getAttribute in interface FtpSessionname - The attribute namepublic void setAttribute(String name, Object value)
setAttribute in interface FtpSessionname - The attribute namevalue - The attribute valuepublic int getMaxIdleTime()
FtpSessionConnectionManagerImpl#getDefaultIdleSec() until user login, and
User.getMaxIdleTime() after user login.getMaxIdleTime in interface FtpSessionpublic void setMaxIdleTime(int maxIdleTime)
FtpSessionConnectionManagerImpl#getDefaultIdleSec() until user login, and
User.getMaxIdleTime() after user login.setMaxIdleTime in interface FtpSessionmaxIdleTime - The number of seconds the client is allowed to be idle before disconnected.public DataType getDataType()
getDataType in interface FtpSessionDataType for this sessionpublic Structure getStructure()
getStructure in interface FtpSessionStructure for this sessionpublic Certificate[] getClientCertificates()
FtpSessiongetClientCertificates in interface FtpSessionpublic InetSocketAddress getServerAddress()
FtpSessiongetServerAddress in interface FtpSessionInetAddresspublic int getFailedLogins()
FtpSessiongetFailedLogins in interface FtpSessionpublic void removeAttribute(String name)
FtpSessionremoveAttribute in interface FtpSessionname - The attribute namepublic void write(FtpReply reply) throws FtpException
FtpSessionwrite in interface FtpSessionreply - The reply that will be sent to the clientFtpExceptionpublic boolean isSecure()
FtpSessionisSecure in interface FtpSessionpublic void increaseWrittenDataBytes(int increment)
increment - The number of bytes writtenpublic void increaseReadDataBytes(int increment)
increment - The number of bytes writtenpublic UUID getSessionId()
getSessionId in interface FtpSessionCopyright © 2003–2025 The Apache Software Foundation. All rights reserved.