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 FtpSession
public DataConnectionFactory getDataConnection()
getDataConnection
in interface FtpSession
DataConnectionFactory
public FileSystemView getFileSystemView()
getFileSystemView
in interface FtpSession
FileSystemView
for this session/userpublic Date getConnectionTime()
getConnectionTime
in interface FtpSession
public Date getLoginTime()
getLoginTime
in interface FtpSession
public Date getLastAccessTime()
getLastAccessTime
in interface FtpSession
public long getFileOffset()
getFileOffset
in interface FtpSession
public FtpFile getRenameFrom()
getRenameFrom
in interface FtpSession
public String getUserArgument()
getUserArgument
in interface FtpSession
public String getLanguage()
getLanguage
in interface FtpSession
public User getUser()
getUser
in interface FtpSession
User
public InetSocketAddress getClientAddress()
getClientAddress
in interface FtpSession
InetAddress
public Object getAttribute(String name)
getAttribute
in interface FtpSession
name
- The attribute namepublic void setAttribute(String name, Object value)
setAttribute
in interface FtpSession
name
- The attribute namevalue
- The attribute valuepublic int getMaxIdleTime()
FtpSession
ConnectionManagerImpl#getDefaultIdleSec()
until user login, and
User.getMaxIdleTime()
after user login.getMaxIdleTime
in interface FtpSession
public void setMaxIdleTime(int maxIdleTime)
FtpSession
ConnectionManagerImpl#getDefaultIdleSec()
until user login, and
User.getMaxIdleTime()
after user login.setMaxIdleTime
in interface FtpSession
maxIdleTime
- The number of seconds the client is allowed to be idle before disconnected.public DataType getDataType()
getDataType
in interface FtpSession
DataType
for this sessionpublic Structure getStructure()
getStructure
in interface FtpSession
Structure
for this sessionpublic Certificate[] getClientCertificates()
FtpSession
getClientCertificates
in interface FtpSession
public InetSocketAddress getServerAddress()
FtpSession
getServerAddress
in interface FtpSession
InetAddress
public int getFailedLogins()
FtpSession
getFailedLogins
in interface FtpSession
public void removeAttribute(String name)
FtpSession
removeAttribute
in interface FtpSession
name
- The attribute namepublic void write(FtpReply reply) throws FtpException
FtpSession
write
in interface FtpSession
reply
- The reply that will be sent to the clientFtpException
public boolean isSecure()
FtpSession
isSecure
in interface FtpSession
public 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 FtpSession
Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.