Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Help with apache mina ftp server

  • 03-01-2009 6: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