Skip to Content
avatar image
Former Member

How to read/write files from a SFTP server, using WebDynpro Java?

Hi All,

We have a requirement, where in, the business user could read /write PDF and excel files respectively to particular locations in the SFTP server.

I have gone through many links but am not getting any thing close to the requirement.

Challenges what I see:

1) It is a SFTP server and just not a FTP server.

2) It is a remote machine.

Solutions which I have thought of:

1) Using respository manager in KM to read/write data in remote server (SFTP server in our case)

2) Have got links like which talks about

how to write a Java program to connect to FTP.

Honestly, I have not tried this in my machine and so not sure how it will perform, that too on SFTP server.

So, request you all here, to let me know how to deal with this requirement, that will not make the application development complex.

Let me know if any body wants additional information or have questions.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Oct 13, 2012 at 02:33 PM

    Hello All,

    Looking forward to all of you for some related information to proceed with the requirement.



    Add comment
    10|10000 characters needed characters exceeded

  • Jun 11, 2013 at 07:01 PM

    Hi DK,

    You can use JSch API which is widely used for connecting a SFTP thru Java.

    below is a sample code to connect and read file from an SFTP server -

    import com.jcraft.jsch.*;

    public class TestJSch {
        public static void main(String args[]) {
            JSch jsch = new JSch();
            Session session = null;
            try {
                session = jsch.getSession("username", "", 22);
                session.setConfig("StrictHostKeyChecking", "no");

                Channel channel = session.openChannel("sftp");
                ChannelSftp sftpChannel = (ChannelSftp) channel;
                sftpChannel.get("remotefile.txt", "localfile.txt");
            } catch (JSchException e) {
            } catch (SftpException e) {

    Add comment
    10|10000 characters needed characters exceeded