Uploaded image for project: 'FtpServer'
  1. FtpServer
  2. FTPSERVER-450

PropertiesUserManager userDataFile is always NULL.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 1.0.6
    • None
    • Core
    • None
    • JDK 6
      Windows 7 64 BIT

    Description

      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

                      PropertiesUserManagerFactory propUserManagerFactory = new PropertiesUserManagerFactory();
      		propUserManagerFactory.setFile(new File("ftpusers.properties"));
      		propUserManagerFactory.setPasswordEncryptor(new ClearTextPasswordEncryptor());
      		mUserManager = (PropertiesUserManager) propUserManagerFactory.createUserManager();
      		mFTPServerFactory.setUserManager(mUserManager);
      

      Set file has no effect because factory will call your constructor

      PropertiesUserManager(passwordEncryptor, userDataFile,
                          adminName)
      and you didn't set this.userDataFile = userDataFile;
      

      complete

        public PropertiesUserManager(PasswordEncryptor passwordEncryptor,
                  File userDataFile, String adminName) {
              super(adminName, passwordEncryptor);
              
              this.userDataFile = userDataFile;
              
              loadFromFile(userDataFile);
          }
      

      Issue fixed

      Note: Please find attached class with issue fixed

      Attachments

        1. PropertiesUserManager.java
          18 kB
          Aizaz AZ
        2. FTPSERVER-450.patch
          0.8 kB
          Uma Maheswara Rao G

        Activity

          People

            Unassigned Unassigned
            AZ_ Aizaz AZ
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: