Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Help with apache mina ftp server

  • 03-01-2009 06:48PM
    #1
    Registered Users, Registered Users 2 Posts: 427 ✭✭


    Hi
    I am using this server in my java application and I am unable to configure it.

    This is the code so far:
    FtpServerFactory serverFactory = new FtpServerFactory();
            
    ListenerFactory factory = new ListenerFactory();
            
    // set the port of the listener
    factory.setPort(2221);
    
    // replace the default listener
    serverFactory.addListener("default", factory.createListener());
                    
    // start the server
    FtpServer server = serverFactory.createServer(); 
            
    server.start();
    

    It is taken from the documentation.This works but there doesn't seem to be any more documentation on the configuration of the server. All other documentation seems to be for the stand alone server.

    I want to setup the server add a user (I think I know how to do this it) and then select a folder on the local file system for sharing (I have no idea how to do this bit). I hope all this can be done through the API, though a configuration file would also be good. Any help would be much appreciated.
    Thanks in advance.
    Kev


Comments

  • Closed Accounts Posts: 30 codecrunchers


    Hi, what about the code below, what happens when you execute this?
    // define SSL configuration
    SslConfigurationFactory ssl = new SslConfigurationFactory();
    ssl.setKeystoreFile(new File("src/test/resources/ftpserver.jks"));
    ssl.setKeystorePassword("password");

    // set the SSL configuration for the listener
    factory.setSslConfiguration(ssl.createSslConfiguration());
    factory.setImplicitSsl(true);

    // replace the default listener
    serverFactory.addListener("default", factory.createListener());

    PropertiesUserManagerFactory userManagerFactory = new PropertiesUserManagerFactory();
    userManagerFactory.setFile(new File("myusers.properties"));

    serverFactory.setUserManager(userManagerFactory.createUserManager());


  • Registered Users, Registered Users 2 Posts: 427 ✭✭Kevo


    Thanks for the reply.

    I am thinking that I will need to find another server. Any idea of a good embeddable ftp server?

    I tried the code you posted but it doesn't let me fully configure the server. I want to specify a folder which can be used as a library. Any ideas?


Advertisement