Re: FTP Server implementation
Hi Rajeev Rajeev kamal wrote: Hello, I want to implement FTP in one of my application. I need to port FTP in such way that the user can stop and start the FTP, add users, do dir listing and do other ftp change. I am trying to use the Embed code but I a) That code is not working What code are you looking at? There might be something which is out of date in our documentation. b) when I change the code, I can start and stop the ftp, but I don't know how to add users, and do other FTP parameter change. A sample code or your suggestion will be very much appreciated. The add (and remove and make other changes) to users, you need to get the UserManager used with your server. Something like this should work: FtpServer server = new FtpServer(); FtpServerContext context = server.getServerContext(); UserManager userManager = context.getUserManager(); BaseUser userToAdd = new BaseUser(); userToAdd.setName("rajeev"); userToAdd.setPassword("secret"); userManager.save(userToAdd); In this case it's using the default UserManager which will store users in a properties file. If you need additional examples, feel free to get back here! I'm not sure of what other FTP parameters you want to change, could you please specify? /niklas
Re: FTP Server implementation
Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. So I downloaded from svn and when I compile the code is throwing some lots of class not found. I am not sure if this is because of my mistake or I am not getting all the file. I was checking the code as it is throwing error for files in import statement. And I don't see those files any where in directory structure. import org.apache.ftpserver.ftplet.Authority; import org.apache.ftpserver.ftplet.Component; import org.apache.ftpserver.ftplet.FileSystemManager; import org.apache.ftpserver.ftplet.FtpStatistics; import org.apache.ftpserver.ftplet.Ftplet; May be you can point me in right direction. Before I was using a jar file file:///C:/Apache%20FTP/ftpserver-dev/ftpserver-dev/common/lib/ftpserver-dev.jar from compiled code as library which had all the classes. I want to do the same using new code. I appreciate your help. Thanks, Rajeev Niklas Gustavsson wrote: Hi Rajeev Rajeev kamal wrote: Hello, I want to implement FTP in one of my application. I need to port FTP in such way that the user can stop and start the FTP, add users, do dir listing and do other ftp change. I am trying to use the Embed code but I a) That code is not working What code are you looking at? There might be something which is out of date in our documentation. b) when I change the code, I can start and stop the ftp, but I don't know how to add users, and do other FTP parameter change. A sample code or your suggestion will be very much appreciated. The add (and remove and make other changes) to users, you need to get the UserManager used with your server. Something like this should work: FtpServer server = new FtpServer(); FtpServerContext context = server.getServerContext(); UserManager userManager = context.getUserManager(); BaseUser userToAdd = new BaseUser(); userToAdd.setName("rajeev"); userToAdd.setPassword("secret"); userManager.save(userToAdd); In this case it's using the default UserManager which will store users in a properties file. If you need additional examples, feel free to get back here! I'm not sure of what other FTP parameters you want to change, could you please specify? /niklas
Re: FTP Server implementation
Rajeev kamal wrote: Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. Yes, the downloads are very old and we should probably remove them. So I downloaded from svn and when I compile the code is throwing some lots of class not found. I am not sure if this is because of my mistake or I am not getting all the file. I was checking the code as it is throwing error for files in import statement. And I don't see those files any where in directory structure. import org.apache.ftpserver.ftplet.Authority; import org.apache.ftpserver.ftplet.Component; import org.apache.ftpserver.ftplet.FileSystemManager; import org.apache.ftpserver.ftplet.FtpStatistics; import org.apache.ftpserver.ftplet.Ftplet; These are all part of the ftplet-api which is now in a separate module found here: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ftplet-api/ If you checkout the entire project from: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ You can then use Maven to build from the root of the project (where you find the first pom.xml) and it should do everything for you. Here are the instructions for both these steps: http://cwiki.apache.org/FTPSERVER/source.html http://cwiki.apache.org/FTPSERVER/building.html Please get back if this does not succeed for you! /niklas
Re: FTP Server implementation
Thanks Niklas, your suggestion was very helpful. Rajeev Niklas Gustavsson wrote: Rajeev kamal wrote: Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. Yes, the downloads are very old and we should probably remove them. So I downloaded from svn and when I compile the code is throwing some lots of class not found. I am not sure if this is because of my mistake or I am not getting all the file. I was checking the code as it is throwing error for files in import statement. And I don't see those files any where in directory structure. import org.apache.ftpserver.ftplet.Authority; import org.apache.ftpserver.ftplet.Component; import org.apache.ftpserver.ftplet.FileSystemManager; import org.apache.ftpserver.ftplet.FtpStatistics; import org.apache.ftpserver.ftplet.Ftplet; These are all part of the ftplet-api which is now in a separate module found here: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ftplet-api/ If you checkout the entire project from: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ You can then use Maven to build from the root of the project (where you find the first pom.xml) and it should do everything for you. Here are the instructions for both these steps: http://cwiki.apache.org/FTPSERVER/source.html http://cwiki.apache.org/FTPSERVER/building.html Please get back if this does not succeed for you! /niklas
Re: FTP Server implementation
How can I download from SVN? Do I need any Client Softtware to do SVN Checkout ? If I clck on http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ it shows all directory/files, but I cannot figure out how to download all files in one time. Ashok Niklas Gustavsson wrote: Rajeev kamal wrote: Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. Yes, the downloads are very old and we should probably remove them. So I downloaded from svn and when I compile the code is throwing some lots of class not found. I am not sure if this is because of my mistake or I am not getting all the file. I was checking the code as it is throwing error for files in import statement. And I don't see those files any where in directory structure. import org.apache.ftpserver.ftplet.Authority; import org.apache.ftpserver.ftplet.Component; import org.apache.ftpserver.ftplet.FileSystemManager; import org.apache.ftpserver.ftplet.FtpStatistics; import org.apache.ftpserver.ftplet.Ftplet; These are all part of the ftplet-api which is now in a separate module found here: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ftplet-api/ If you checkout the entire project from: http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ You can then use Maven to build from the root of the project (where you find the first pom.xml) and it should do everything for you. Here are the instructions for both these steps: http://cwiki.apache.org/FTPSERVER/source.html http://cwiki.apache.org/FTPSERVER/building.html Please get back if this does not succeed for you! /niklas
Re: FTP Server implementation
Niklas Gustavsson wrote: Rajeev kamal wrote: Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. Yes, the downloads are very old and we should probably remove them. Instead of "we should probably remove very old src", why not update with Latest Src ? Both Src (old or new) is open source, and may contain bugs, but newer one would contain less bugs. Thank, Ashok
Re: FTP Server implementation
Ashok Patel wrote: How can I download from SVN? Do I need any Client Softtware to do SVN Checkout ? If I clck on http://svn.apache.org/repos/asf/incubator/ftpserver/trunk/ it shows all directory/files, but I cannot figure out how to download all files in one time. Yes, you need to use a Subversion client. If you are on Windows, I would recommaned TortoiseSVN (http://tortoisesvn.tigris.org/). This was clear in our documentation so I've added it. Thanks for noticing! /niklas
Re: FTP Server implementation
Ashok Patel wrote: Niklas Gustavsson wrote: Rajeev kamal wrote: Thanks Niklas for the reply. I found out that the src and compiled ftp on the web site for download do not have the functionality as you stated in your code. Yes, the downloads are very old and we should probably remove them. Instead of "we should probably remove very old src", why not update with Latest Src ? Both Src (old or new) is open source, and may contain bugs, but newer one would contain less bugs. Yes, I agree. However, the Apache rules around releasing requires that we first vote on this list and then, after a successful vote asks the Incubator to vote. If that succeeds, we're allowed to release. There is currently a vote ongoing here for the first step. If that is approved, we'll move on to getting a release out. /niklas