how to client
Are there any examples on writing a client to to use the server? thanks, micah
Re: how to client
No, you'd use a regular FTP client to connect to the server.There're several Java implementations of a FtpClient you can use. The simplest case: if i'm not wrong you can use a 'ftp://' string in order to create an URL with Java standard classes which will effectively connect you to the specified ftpserver. Apache commons net ftp client is used in FtpServer client tests and it looks like a very good option(I'm using apache commons ftp myself in our custom client). 2008/10/14 micah [EMAIL PROTECTED] Are there any examples on writing a client to to use the server? thanks, micah
Re: how to client
2008/10/14 Andrea Francia [EMAIL PROTECTED] 2008/10/14 David Latorre [EMAIL PROTECTED]: No, you'd use a regular FTP client to connect to the server.There're several Java implementations of a FtpClient you can use. The simplest case: if i'm not wrong you can use a 'ftp://' string in order to create an URL with Java standard classes which will effectively connect you to the specified ftpserver. Apache commons net ftp client is used in FtpServer client tests and it looks like a very good option(I'm using apache commons ftp myself in our custom client). A thing that I really don't like about Apache commons net Ftp Client is that you should uses getReply() and FTPReply.isPositiveCompletion(reply) instead of exceptions to handle command failures. Yeah sure that's a pain. But I haven't tested any good alternatives to commons-net. Feel free to suggest any! What I really don't like about commons-net and makes it much less usable is that it seems i cannot override the ip address returned by PASV command so I can open a data socket to the IP that I connected to (that of the control channel) instead of the IP returned by PASV. If i remember correctly, most UI-based ftp clients can do that. -- Andrea Francia http://andreafrancia.blogspot.com/
Re: how to client
Something that I am using at work with great success is an ftp client called enterprisedt. I replaced commons-net with this new free ftp for java client and it is working great, check it out. http://www.enterprisedt.com/ Thanks, Nick Vujasin - Original Message From: David Latorre [EMAIL PROTECTED] To: ftpserver-users@mina.apache.org Sent: Tuesday, October 14, 2008 1:43:37 PM Subject: Re: how to client 2008/10/14 Andrea Francia [EMAIL PROTECTED] 2008/10/14 David Latorre [EMAIL PROTECTED]: No, you'd use a regular FTP client to connect to the server.There're several Java implementations of a FtpClient you can use. The simplest case: if i'm not wrong you can use a 'ftp://' string in order to create an URL with Java standard classes which will effectively connect you to the specified ftpserver. Apache commons net ftp client is used in FtpServer client tests and it looks like a very good option(I'm using apache commons ftp myself in our custom client). A thing that I really don't like about Apache commons net Ftp Client is that you should uses getReply() and FTPReply.isPositiveCompletion(reply) instead of exceptions to handle command failures. Yeah sure that's a pain. But I haven't tested any good alternatives to commons-net. Feel free to suggest any! What I really don't like about commons-net and makes it much less usable is that it seems i cannot override the ip address returned by PASV command so I can open a data socket to the IP that I connected to (that of the control channel) instead of the IP returned by PASV. If i remember correctly, most UI-based ftp clients can do that. -- Andrea Francia http://andreafrancia.blogspot.com/
Any simple way to make Spring auto-call start() on FtpServer when it is registered using the server tags?
Can anyone recommend a simple way to force Spring to automatically call FTPServer.start() when Spring gets an instance of it through BeanFactory? Keep in mind, FTPServer is not registered with Spring through the applicationContext, but rather using the server /server element configuration file. I have found plenty of solutions which work only if FTPServer has been configured within applicationContext.xml. But of course, the recommended and the Only Documented way to register FTPServer in Spring is using a separate server/server XML file, separate from applicationContext.xml. This is the way it is instantiated in my Spring app, too. So I need to find out how to get Spring to automatically call its .start() method after auto-instantiation. Why is this necessary? Because of the way Spring works, and the fact that FTPServer is a standalone Server application-not an HttpServlet. Therefore, something has to call .start() on the Server---but you can't just write a main() method to do it, because there is no way to command a main() method to be executed by Spring when it is deployed to and run on an Application server. You get to deploy an EAR file to a remote server. From there, Spring and the remote server call all the shots. So there has to be some configuration to tell Spring to call .start() on the instance of FtpServer it automatically instantiates. If you know Spring, you'll know why. How do I configure this call to start()? A main() method is useless, deployed.
Re: how to client
2008/10/14 David Latorre [EMAIL PROTECTED]: No, you'd use a regular FTP client to connect to the server.There're several Java implementations of a FtpClient you can use. The simplest case: if i'm not wrong you can use a 'ftp://' string in order to create an URL with Java standard classes which will effectively connect you to the specified ftpserver. Apache commons net ftp client is used in FtpServer client tests and it looks like a very good option(I'm using apache commons ftp myself in our custom client). A thing that I really don't like about Apache commons net Ftp Client is that you should uses getReply() and FTPReply.isPositiveCompletion(reply) instead of exceptions to handle command failures. -- Andrea Francia http://andreafrancia.blogspot.com/