Path ftpServerRoot = new Path(workDir, "FTPServer");
Path ftpServerConfig = null;
private void startServer() {
try {
DefaultFtpServerContext context = new DefaultFtpServerContext(false);
MinaListener listener = new MinaListener();
// Set port to 0 for OS to give a free port
listener.setPort(0);
context.setListener("default", listener);
// Create a test user.
UserManager userManager = context.getUserManager();
BaseUser adminUser = new BaseUser();
adminUser.setName("admin");
adminUser.setPassword("admin");
adminUser.setEnabled(true);
adminUser.setAuthorities(new Authority[] { new WritePermission() });