I was trying to implement use of VSF when you give me this tip. I check the website you provided ( http://vfs-utils.sourceforge.net/ftpserver/index.html): *To use this bridge you should just add the VFS libraries, the VFS FTP Server library and, if needed, your custom VFS Provider and its dependencies to the common/lib directory of your Apache FTP Server installation.*
So, I've added the following libs to my project: commons-vfs-1.0.jar ftplet-api-1.0.5.jar ftpserver-core-1.0.5.jar mina-core-2.0.0-RC1.jar slf4j-api-1.5.2.jar slf4j-log4j12-1.5.2.jar <http://vfs-utils.sourceforge.net/ftpserver/index.html>The FTP server started and works, but doesn´t with VSF. This is code I'm using: > FtpServerFactory serverFactory = new FtpServerFactory(); ListenerFactory factory = new ListenerFactory(); factory.setPort(21); serverFactory.addListener("default", factory.createListener()); > PropertiesUserManagerFactory userManagerFactory = new > PropertiesUserManagerFactory(); userManagerFactory.setFile(new File("etc/ftp-users.properties")); userManagerFactory.setPasswordEncryptor(new SaltedPasswordEncryptor()); > BaseUser user = new BaseUser(); user.setName("danilo"); user.setPassword("mypass"); user.setHomeDirectory("ram://ftp/danilo"); user.setEnabled(true); List<Authority> authorities = new ArrayList<Authority>(); authorities.add(new WritePermission()); user.setAuthorities(authorities); > UserManager um = userManagerFactory.createUserManager(); um.save(user); serverFactory.setUserManager(um); > FtpServer server = serverFactory.createServer(); server.start(); Test creating a dir: > ftp> mkdir test 550 Can't create directory /test. Test uploading file: > ftp> send Arquivo local c:/a.rar Arquivo remoto a.rar 200 Command PORT okay. 150 File status okay; about to open data connection. 551 /a.rar: Error on output file. Any ideas ? Thanks a lot, On Sun, Oct 17, 2010 at 7:22 PM, Frank van der Kleij <[email protected]>wrote: > > Another option - though one that gives you slightly less control is to use > the VFS filesystem plugin for the FTP server ( > http://vfs-utils.sourceforge.net/ftpserver/index.html) because then you > can use the ram:// filesystem ( > http://commons.apache.org/vfs/filesystems.html#ram) that works on > memory.Frank > > Date: Fri, 15 Oct 2010 17:26:40 +0200 > > Subject: Re: FtpServer - Receive files by memory > > From: [email protected] > > To: [email protected] > > > > 2010/10/15 Danilo Rosetto Muñoz <[email protected]>: > > > I would like to know some way to get FTP received files directly from > > > memory. I mean redirect file transfers to the memory and listening > them. I > > > want this in order to embbeded a FTP Server on my app and handling new > > > files through memory without using filesystem. > > > > The best way of doing this would be using an in-memory file system > > (implementing FileSystemFactory, FileSystemView and FtpFile). We do > > not supply one, but it would certainly be possible to implement one. > > > > /niklas > > -- Danilo Rosetto Muñoz [email protected] http://munozdanilo.googlepages.com
