SFTP over SSH2

Hi
I want to connect using SFTP over SSH2 !
I've tried jscape, unfortunately its not free
any <<< Free >>> library ?
any sample code ?
would be appreciated
LVL 14
hoomanvAsked:
Who is Participating?
 
girionisCommented:
Here you can find a few jsch examples: http://www.jcraft.com/jsch/examples/
0
 
hoomanvAuthor Commented:
0
 
Mayank SAssociate Director - Product EngineeringCommented:
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
hoomanvAuthor Commented:
JFTP ... actually this is a graphical ftp client. do you know any sample code using this lib ?

jscape is very simple as you can see below

            // create a new SshParameters instance with authentication info
            SshParameters sshParams = new SshParameters(host, user, password);
            // create a new Sftp instance
            Sftp sftp = new Sftp(sshParams);
            // establish a connection
            sftp.connect();
            // turn off auto transfer mode detection if enabled
            sftp.setAuto(false);
            // set transfer mode to binary
            sftp.setBinary();
            // download all files ending with .gif extension to current local directory
            sftp.mdownload("pass.txt");
            // disconnect from SSH server
            sftp.disconnect();

is there any free lib that is as simple as jscape ?
0
 
KantiCommented:
0
 
Mayank SAssociate Director - Product EngineeringCommented:
Nopes, sorry. Might not be as simple. Have you tried the others on that page like JSch? It supports file transfer too.
0
 
hoomanvAuthor Commented:
> Have you tried the others on that page like JSch ?

I've downloaded it, but the problem is that I dont know how to use it.
Im realy looking for somthing easy like jakarta FTPClient or jscape which have been specifically written for FTP related operations

there are a lot of libs which support SSH2 but how to do FTP with them ?
0
 
hoomanvAuthor Commented:
although I had seen this sample code before but disregarded it (because of its low level impl), you made me try it and it worked as well

thanks anyway
0
 
girionisCommented:
Thank you for accepting, glad problem is solved :)
0
 
hoomanvAuthor Commented:
apparently, there is no javadoc for jsch :)
0
 
girionisCommented:
Nope :( it's not well documented. The only way is to look at the sample programmes and try to find out what each class does.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.