Where did you put ftpusers.properties? You shouldn't use a relative path to the
file in your code. Try to use the absolute path, for example:
userManagerFactory.setFile(new File("/home/ftp/conf/ftpusers.properties"));
-----Original Message-----
From: Dustine Rene Bernasor [mailto:[email protected]]
Sent: Tuesday, March 29, 2011 3:58 PM
To: [email protected]
Subject: Question on using PropertiesUserManagerFactory
Hello,
I am trying to embed the Apache FTP server into my code. I have a property file
containing a single user but when I try to connect, I get a 530 error.
Here's the content of my property file:
ftpserver.user.test.homedirectory=./test-tmp/ftproot
ftpserver.user.test.maxloginnumber=3
ftpserver.user.test.enableflag=true
ftpserver.user.test.writepermission=true
ftpserver.user.test.userpassword=password
Here's the code for the user management:
PropertiesUserManagerFactory userManagerFactory = new
PropertiesUserManagerFactory(); userManagerFactory.setFile(new
File("ftpusers.properties")); UserManager um =
userManagerFactory.createUserManager();
serverFactory.setUserManager(um);
I've tried adding this code for investigation purposes:
users = um.getAllUserNames();
System.out.println(users.length);
but 0 is printed. So it seems the user configuration from the property file was
not loaded.
Can someone point out if I missed a particular step.
Thanks.
Dustine