This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Files Involved: 1. Properties file: that has FTP site address, username and password and remote directory. 2. FTPConnection.java: java class that reads the property file and opens connection to the FTP site and logs in. This should also have methods to get output stream through which you can write data. 3. Process FTP: Java class to get the information that needs to be FTPed. Get the connection by calling appropriate method on FTPConnection class, Get outputstream from FTPConnection and write data to it. Atlast close the connection.
Flow: 1. JSP should have a button/link/any means to trigger FTP process. When user trigger this process, request will be sent to your servlet/controller. 2. Controller/servlet will make a call onto ProcessFTP class which would get the FTP connection, write data and close Connection as described above.
I have used Apache FTP.
Hope this helps.
Please let me know if you have a better approach.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com