You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Bart Berger <bb...@Brocade.COM> on 2011/10/19 02:47:31 UTC
Beginner's documentation or tutorial?
Hi,
I'm having difficulty learning the basics of embedding the Apache FtpServer in my app. Is there any documentation other than what's at http://mina.apache.org/ftpserver/documentation.html, or did I miss a crucial link?
I generated the javadoc from downloaded sources, and that helps a little, but still leaves many questions unanswered.
For example, the 5-minute tutorial says to start the server with:
FtpServerFactory serverFactory = new FtpServerFactory();
FtpServer server = serverFactory.createServer();
server.start();
But how do I use ftpd.xml file to configure the server? I'm hoping there is just some way to specify the location of ftpd.xml that I missed.
I'd also like to programmatically create a user with write permission. UserFactory wants a list of Authority objects, but I've been unable to figure out how to create the Authority objects.
Any pointers to basic setup info would be greatly appreciated!
Thanks,
Bart
Re: Beginner's documentation or tutorial?
Posted by Niklas Gustavsson <ni...@protocol7.com>.
On Wed, Oct 19, 2011 at 2:47 AM, Bart Berger <bb...@brocade.com> wrote:
> But how do I use ftpd.xml file to configure the server? I'm hoping there is just some way to specify the location of ftpd.xml that I missed.
ftpd.xml is a Spring bean definition, so you need to load it using
Spring. Something like:
FileSystemXmlApplicationContext ctx = new
FileSystemXmlApplicationContext("ftpd.xml");
FtpServer server = (FtpServer) ctx.getBean("server");
> I'd also like to programmatically create a user with write permission. UserFactory wants a list of Authority objects, but I've been unable to figure out how to create the Authority objects.
Use UserFactory.setAuthorities() and add a
org.apache.ftpserver.usermanager.impl.WritePermission.
Hope that will get you started.
/niklas