Tuesday, June 23, 2015

JSch - Upload/download files from remote server

We will using JSch to connect our unix box. Once connected you should be able to upload or download the required files.

JSch is a pure Java implementation of SSH2. To know more click here.

For running below code you need to add jsh jar file (e.g. jsch-0.1.53.jar) in your applications classpath. Download jsch-0.1.53.jar from here.

Please see the self explanatory code below -