|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ftpserver.usermanager.impl.AbstractUserManager
org.apache.ftpserver.usermanager.impl.PropertiesUserManager
public class PropertiesUserManager
Internal class, do not use directly.
Properties file based UserManager
implementation. We use
user.properties
file to store user data.
Property | Documentation |
---|---|
ftpserver.user.{username}.homedirectory | Path to the home directory for the user, based on the file system implementation used |
ftpserver.user.{username}.userpassword | The password for the user. Can be in clear text, MD5 hash or salted SHA hash based on the configuration on the user manager |
ftpserver.user.{username}.enableflag | true if the user is enabled, false otherwise |
ftpserver.user.{username}.writepermission | true if the user is allowed to upload files and create directories, false otherwise |
ftpserver.user.{username}.idletime | The number of seconds the user is allowed to be idle before disconnected. 0 disables the idle timeout |
ftpserver.user.{username}.maxloginnumber | The maximum number of concurrent logins by the user. 0 disables the check. |
ftpserver.user.{username}.maxloginperip | The maximum number of concurrent logins from the same IP address by the user. 0 disables the check. |
ftpserver.user.{username}.uploadrate | The maximum number of bytes per second the user is allowed to upload files. 0 disables the check. |
ftpserver.user.{username}.downloadrate | The maximum number of bytes per second the user is allowed to download files. 0 disables the check. |
Example:
ftpserver.user.admin.homedirectory=/ftproot ftpserver.user.admin.userpassword=admin ftpserver.user.admin.enableflag=true ftpserver.user.admin.writepermission=true ftpserver.user.admin.idletime=0 ftpserver.user.admin.maxloginnumber=0 ftpserver.user.admin.maxloginperip=0 ftpserver.user.admin.uploadrate=0 ftpserver.user.admin.downloadrate=0
Field Summary |
---|
Fields inherited from class org.apache.ftpserver.usermanager.impl.AbstractUserManager |
---|
ATTR_ENABLE, ATTR_HOME, ATTR_LOGIN, ATTR_MAX_DOWNLOAD_RATE, ATTR_MAX_IDLE_TIME, ATTR_MAX_LOGIN_NUMBER, ATTR_MAX_LOGIN_PER_IP, ATTR_MAX_UPLOAD_RATE, ATTR_PASSWORD, ATTR_WRITE_PERM |
Constructor Summary | |
---|---|
PropertiesUserManager(PasswordEncryptor passwordEncryptor,
java.io.File userDataFile,
java.lang.String adminName)
Internal constructor, do not use directly. |
|
PropertiesUserManager(PasswordEncryptor passwordEncryptor,
java.net.URL userDataPath,
java.lang.String adminName)
Internal constructor, do not use directly. |
Method Summary | |
---|---|
User |
authenticate(Authentication authentication)
User authenticate method |
void |
delete(java.lang.String usrName)
Delete an user. |
void |
dispose()
Close the user manager - remove existing entries. |
boolean |
doesExist(java.lang.String name)
User existance check |
java.lang.String[] |
getAllUserNames()
Get all user names. |
java.io.File |
getFile()
Retrive the file backing this user manager |
User |
getUserByName(java.lang.String userName)
Load user data. |
void |
refresh()
Reloads the contents of the user.properties file. |
void |
save(User usr)
Save user data. |
Methods inherited from class org.apache.ftpserver.usermanager.impl.AbstractUserManager |
---|
getAdminName, getPasswordEncryptor, isAdmin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertiesUserManager(PasswordEncryptor passwordEncryptor, java.io.File userDataFile, java.lang.String adminName)
PropertiesUserManagerFactory
instead.
public PropertiesUserManager(PasswordEncryptor passwordEncryptor, java.net.URL userDataPath, java.lang.String adminName)
PropertiesUserManagerFactory
instead.
Method Detail |
---|
public void refresh()
public java.io.File getFile()
public void save(User usr) throws FtpException
usr
- the Uset to save
FtpException
- when the UserManager can't fulfill the request.public void delete(java.lang.String usrName) throws FtpException
usrName
- The name of the User
to delete
FtpException
- when the UserManager can't fulfill the request.public java.lang.String[] getAllUserNames()
public User getUserByName(java.lang.String userName)
userName
- the name to search for.
public boolean doesExist(java.lang.String name)
name
- the name of the user to check.
public User authenticate(Authentication authentication) throws AuthenticationFailedException
authentication
- The Authentication
that proves the users identity
AuthenticationFailedException
public void dispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |