All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class kmy.net.ftpd.FTPDUser

kmy.net.ftpd.FTPDUser

public class FTPDUser
An object that represents FTP user. It is used to obtain authentication when user is logging into the server. A challenge-reply authentication can be implemented, since simple 32bit challenge is sent with every request for password. This challenge can be used to encript/scramble password before sending. To generate more complex challenge you need to override FTPDConnection.nextChallenge(). This object is also used to produce resource object that are being accessed via FTP. That means that equivalet paths can lead to different resources for different users. There are also methods that facilitate read/write access verification.


Constructor Index

 o FTPDUser()
Create new (uninitialized) FTP user object
 o FTPDUser(String, String, String, boolean)
Create new FTP user with given properties

Method Index

 o getHome()
Get user's home directory
 o getName()
Get user name
 o getPrefix()
Get prefix string - a string to prepend to every path to obtain complete resource path
 o produceObject(String, FTPDaemon)
Produce a resource object that is referenced by the given path.
 o setPrefix(String)
Set prefix string - a string to prepend to every path to obtain complete resource path
 o verifyPassword(String, String)
Verify password.
 o verifyReadAccess(String)
Verify if user has read access for the resource represented this path.
 o verifyWriteAccess(String)
Verify if user has write access for the resource represented this path.

Constructors

 o FTPDUser
 public FTPDUser()
Create new (uninitialized) FTP user object

 o FTPDUser
 public FTPDUser(String _name,
                 String _password,
                 String _home,
                 boolean homeOnlyAccess)
Create new FTP user with given properties

Parameters:
_name - user's login name
_password - user's secret password
_home - user's home directory
homeOnlyAccess - if access is limited to the subfolders of home directory only

Methods

 o setPrefix
 public void setPrefix(String prefixString)
Set prefix string - a string to prepend to every path to obtain complete resource path

 o getPrefix
 public String getPrefix()
Get prefix string - a string to prepend to every path to obtain complete resource path

 o getName
 public final String getName()
Get user name

 o getHome
 public String getHome()
Get user's home directory

 o verifyPassword
 public String verifyPassword(String pass,
                              String challenge)
Verify password. If challenge-reply scheme is used challenge can be used to encript user's real password before comparing with client's reply. On success this method returns user's home directory, otherwise - null.

Parameters:
pass - password as sent by the client (may be encripted)
challenge - challenge that was sent to the client as a part of the request for the password. Not used in the default implementation.
 o produceObject
 public VirtualObject produceObject(String path,
                                    FTPDaemon server) throws FTPDException
Produce a resource object that is referenced by the given path.

Throws: FTPDException
if object cannot be produced for the path given
 o verifyReadAccess
 public boolean verifyReadAccess(String path)
Verify if user has read access for the resource represented this path.

 o verifyWriteAccess
 public boolean verifyWriteAccess(String path)
Verify if user has write access for the resource represented this path.


All Packages  Class Hierarchy  This Package  Previous  Next  Index