package core;

import java.io.InputStream;

import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpException;

public class FTP {
	public static void upload(InputStream file, String fileName) {
		try {
			JSch jsch = new JSch();
			Session session = jsch.getSession(Constants.FTP_USER, Constants.FTP_HOST, 22);
			session.setConfig("PreferredAuthentications", "password");
			session.setConfig("StrictHostKeyChecking", "no");
			session.setPassword(Constants.FTP_PASS);
			session.connect();
			Channel channel = session.openChannel("sftp");
			ChannelSftp sftp = (ChannelSftp) channel;
			sftp.connect();
			sftp.put(file, Constants.FTP_DIR + fileName);
			sftp.quit();
			channel.disconnect();
			session.disconnect();
		} catch (JSchException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SftpException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

@@ -293,12 +293,14 @@
 tic 
-void
+String
  upl
@@ -878,24 +878,70 @@
 connect();%0D%0A
+%09%09%09return Constants.FTP_BASEPATH + fileName;%0D%0A
 %09%09%7D catch (J
@@ -1123,15 +1123,31 @@
 ;%0D%0A%09%09%7D%0D%0A
+%09%09return null;%0D%0A
 %09%7D%0D%0A%7D%0D%0A

Modify Method - FTP.upload Add Return.