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 Thomaz Luiz Santos <th...@gmail.com> on 2013/02/11 12:26:27 UTC

receive / send files

hello!

I'm having problems sending and receiving files in my test application, I
need to start receiving files from a client, and manipulate them, and send
to another server, in case  that files received are a svg, and an image
file, these two files I use them to generate another file and that file
will be sent to another server, my problem in itself and capture the input
files, could someone explain to me how it is done using the ftplet think he
can solve my problem, but I not can find any example of use, like my case.
Recalling that will always be sent by the client these two files (svg and
image), and with the same name.


        FtpServerFactory serverFactory = new FtpServerFactory();
        ListenerFactory factory = new ListenerFactory();
        factory.setPort(21);
        serverFactory.addListener("default", factory.createListener());
        FtpServer server = serverFactory.createServer();
        PropertiesUserManagerFactory userManagerFactory = new
PropertiesUserManagerFactory();
        userManagerFactory.setFile(new File("/config/users.properties"));

serverFactory.setUserManager(userManagerFactory.createUserManager());

        BaseUser user = new BaseUser();
        user.setName("admin");
        user.setPassword("admin");
        user.setHomeDirectory("/ftpteste/");
        ArrayList<Authority> authorities = new ArrayList<Authority>();
        authorities.add(new WritePermission());
        user.setAuthorities(authorities);
        UserManager um = userManagerFactory.createUserManager();
        um.save(user);
        serverFactory.setUserManager(um);
        Map<String, Ftplet> m = new HashMap<String, Ftplet>();

        serverFactory.setFtplets(m);
        server.start();

-- 
------------------------------
Thomaz Luiz Santos
Linux User: #359356
http://thomaz.santos.googlepages.com/