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.
-
FTPDUser()
- Create new (uninitialized) FTP user object
-
FTPDUser(String, String, String, boolean)
- Create new FTP user with given properties
-
getHome()
- Get user's home directory
-
getName()
- Get user name
-
getPrefix()
- Get prefix string - a string to prepend to every path to obtain
complete resource path
-
produceObject(String, FTPDaemon)
- Produce a resource object that is referenced by the given path.
-
setPrefix(String)
- Set prefix string - a string to prepend to every path to obtain
complete resource path
-
verifyPassword(String, String)
- Verify password.
-
verifyReadAccess(String)
- Verify if user has read access for the resource represented
this path.
-
verifyWriteAccess(String)
- Verify if user has write access for the resource represented
this path.
FTPDUser
public FTPDUser()
- Create new (uninitialized) FTP user object
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
setPrefix
public void setPrefix(String prefixString)
- Set prefix string - a string to prepend to every path to obtain
complete resource path
getPrefix
public String getPrefix()
- Get prefix string - a string to prepend to every path to obtain
complete resource path
getName
public final String getName()
- Get user name
getHome
public String getHome()
- Get user's home directory
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.
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
verifyReadAccess
public boolean verifyReadAccess(String path)
- Verify if user has read access for the resource represented
this path.
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