I have a scheduler in my application which periodically processes XML files saved on a FTP server. Recently my organisation has replaced the server with a SFTP server. I have downloaded the API SFTP.zip and am trying to implement the following steps : 1) connect to the server 2) change the directory 3) read an XML file .
The first two steps are running without an excpetion, but I can't find a counterpart of
Quote: byte result = ftp.get(fileName);
which I was using for normal FTP server.
My incomplete code follows :
Please let me know if such an implementation is possible . If not, please suggest a way using which I can read XML files stored on SFTP server and after reading rename the file with a suffix '.PROCESSED'.
Thanks in advance
[ November 10, 2008: Message edited by: Aniruddh Joshi ]
[ November 10, 2008: Message edited by: Aniruddh Joshi ] [ November 10, 2008: Message edited by: Aniruddh Joshi ]
"One of the best things you could do is to simplify a larger application into a smaller one by reducing its process and complexity - Fowler"
author and iconoclast
I Googled quickly for this class, and I see methods named "download()", which generally place the downloaded data into a file for you, or "getInputStream()" which would allow you to read the data into an array (if that's what you wanted to do.) Did you look at the Javadoc?
Hi Aniruddh, Actually, I am not replying to your question. The point is I too need to develop a tool that does similar kind of processing as you need to. Pleae tell where did you download the SFTP API from ? And, where can I get all other related API like FTP, SSH etc.