Java SFTP client application in Cloud Foundary Environment

I have a java application ,which trasfters a file to SFTP server.
Our application use jsch for implementation of sftp client in java.

Jsch requires below parameters to connect to a SFTP server:

Host name of SFTP server: XX.XX.XXX.XXX
Port : 22
Username : abc
Password : ****

My application is working fine and transferring the file when I deploy it on Unix boxes or run in my local machine.

Now I am going to deploy the application on Cloud Foundry, but this is giving me ConnectException.

2018-03-14T19:07:40.41+0530 [APP/PROC/WEB/0] OUT com.jcraft.jsch.JSchException: Connection refused (Connection refused)

I have updated the security group :

    "destination": "XX.XX.XXX.XXX",
    "protocol": "tcp",
    "ports": "22"


  1. “protocol”: “sftp” is invalid ,so I gave “protocol”: “tcp”

  2. Cloud foundary(Private cloud) and SFTP server both are in my local premises.

  3. I read about volume services but ,I did not find any clue. We do not have marketplace accessible, so If volume service can help then we will have to build those service.


How can I access my SFTP server via a application which is deployed on Cloud Foundry?