PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
userManagerFactory.setFile(new File("myusers.properties"));
userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor());
UserManager um = userManagerFactory.createUserManager();
UserFactory userFact = new UserFactory();
userFact.setName("myNewUser");
userFact.setPassword("secret");
userFact.setHomeDirectory("ftproot");
User user = userFact.createUser();
um.save(user);
}