[
https://issues.apache.org/jira/browse/FTPSERVER-450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13800511#comment-13800511
]
Uma Maheswara Rao G commented on FTPSERVER-450:
-----------------------------------------------
{quote}
Good approach will be when user calls
{quote}
Yes, above SVN patch should also does the same. In Ctor, we are calling
loadFromFile, thus method does this initialization on non-null now and that
change just made like the other ctor with urlPath initialization in loadFromUrl.
Thanks for reporting it.
Committers can take and look and commit the change for this issue if they also
feel this change needed to go in.
> PropertiesUserManager userDataFile is always NULL.
> ---------------------------------------------------
>
> Key: FTPSERVER-450
> URL: https://issues.apache.org/jira/browse/FTPSERVER-450
> Project: FtpServer
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.0.6
> Environment: JDK 6
> Windows 7 64 BIT
> Reporter: Aizaz AZ
> Priority: Blocker
> Attachments: FTPSERVER-450.patch, PropertiesUserManager.java
>
>
> PropertiesUserManager userDataFile is always NULL. Because you didn't set
> your class variable value equal to what you get in constructor when
> PropertiesUserManagerFactory calls your constructor new
> PropertiesUserManager(passwordEncryptor, userDataFile, adminName); of
> PropertiesUserManager,just need to do below super this.userDataFile =
> userDataFile; and issue is fixed
> {code}
> PropertiesUserManagerFactory propUserManagerFactory = new
> PropertiesUserManagerFactory();
> propUserManagerFactory.setFile(new File("ftpusers.properties"));
> propUserManagerFactory.setPasswordEncryptor(new
> ClearTextPasswordEncryptor());
> mUserManager = (PropertiesUserManager)
> propUserManagerFactory.createUserManager();
> mFTPServerFactory.setUserManager(mUserManager);
> {code}
> Set file has no effect because factory will call your constructor
> {code}PropertiesUserManager(passwordEncryptor, userDataFile,
> adminName)
> and you didn't set this.userDataFile = userDataFile;
> {code}
> complete
> {code}
> public PropertiesUserManager(PasswordEncryptor passwordEncryptor,
> File userDataFile, String adminName) {
> super(adminName, passwordEncryptor);
>
> this.userDataFile = userDataFile;
>
> loadFromFile(userDataFile);
> }
> {code}
> Issue fixed
> Note: Please find attached class with issue fixed
--
This message was sent by Atlassian JIRA
(v6.1#6144)