org.apache.ftpserver.ftplet
Interface FtpSession


public interface FtpSession

Defines an client session with the FTP server. The session is born when the client connects and dies when the client disconnects. Ftplet methods will always get the same session for one user and one connection. So the attributes set by setAttribute() will be always available later unless that attribute is removed or the client disconnects.


Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.
 java.net.InetAddress getClientAddress()
          Returns the IP address of the client that sent the request.
 java.security.cert.Certificate[] getClientCertificates()
           
 java.util.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 upload/download offset.
 FileSystemView getFileSystemView()
          Get user file system view.
 java.lang.String getLanguage()
          Get the requested language.
 java.util.Date getLastAccessTime()
          Get last access time.
 java.util.Date getLoginTime()
          Get the login time.
 int getMaxIdleTime()
          Returns maximum idle time.
 FileObject getRenameFrom()
          Get rename from file object.
 java.net.InetAddress getServerAddress()
           
 int getServerPort()
           
 Structure getStructure()
          Get structure.
 User getUser()
          Get user object.
 java.lang.String getUserArgument()
          Returns user name entered in USER command
 boolean isLoggedIn()
          Is the user logged in?
 void removeAttribute(java.lang.String name)
          Removes an attribute from this request.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Stores an attribute in this request.
 void setMaxIdleTime(int maxIdleTimeSec)
          Set maximum idle time in seconds.
 

Method Detail

getClientAddress

java.net.InetAddress getClientAddress()
Returns the IP address of the client that sent the request.


getServerAddress

java.net.InetAddress getServerAddress()

getServerPort

int getServerPort()

getDataConnection

DataConnectionFactory getDataConnection()
Get FTP data connection.


getClientCertificates

java.security.cert.Certificate[] getClientCertificates()

getConnectionTime

java.util.Date getConnectionTime()
Get connection time.


getLoginTime

java.util.Date getLoginTime()
Get the login time.


getFailedLogins

int getFailedLogins()
Get the number of failed logins. When login succeeds, this will return 0.


getLastAccessTime

java.util.Date getLastAccessTime()
Get last access time.


getMaxIdleTime

int getMaxIdleTime()
Returns maximum idle time. This time equals to ConnectionManagerImpl#getDefaultIdleSec() until user login, and User.getMaxIdleTime() after user login.


setMaxIdleTime

void setMaxIdleTime(int maxIdleTimeSec)
Set maximum idle time in seconds. This time equals to ConnectionManagerImpl#getDefaultIdleSec() until user login, and User.getMaxIdleTime() after user login.


getUser

User getUser()
Get user object.


getUserArgument

java.lang.String getUserArgument()
Returns user name entered in USER command

Returns:
user name entered in USER command

getLanguage

java.lang.String getLanguage()
Get the requested language.


isLoggedIn

boolean isLoggedIn()
Is the user logged in?


getFileSystemView

FileSystemView getFileSystemView()
Get user file system view.


getFileOffset

long getFileOffset()
Get file upload/download offset.


getRenameFrom

FileObject getRenameFrom()
Get rename from file object.


getDataType

DataType getDataType()
Get the data type.


getStructure

Structure getStructure()
Get structure.


getAttribute

java.lang.Object getAttribute(java.lang.String name)
Returns the value of the named attribute as an Object, or null if no attribute of the given name exists.


setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Stores an attribute in this request. It will be available until it was removed or when the connection ends.


removeAttribute

void removeAttribute(java.lang.String name)
Removes an attribute from this request.



Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.