HI,
i used a small SFTP Client(java) to Connect to the SFTP Server and transfer a file. i can transfer the file successfully, but
how do confirm that the file content are secure.
Client : java SFTP Clinet using Jsch lib
Server : FTPShell Server
client program is
import com.jcraft.jsch.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class SftpClient {
public static void main(String args[]) {
JSch jsch = new JSch();
Session session = null;
try {
session = jsch.getSession("user", "host",port);
session.setConfig("StrictHostKeyChecking", "no");
session.setPassword("pass");
session.connect();
Channel channel = session.openChannel("sftp");
channel.connect();
ChannelSftp sftpChannel = (ChannelSftp) channel;
File file = new File("c:\\hello.txt");
sftpChannel.put(new FileInputStream(file),"helloo.txt");
sftpChannel.exit();
session.disconnect();
} catch (JSchException e) {
e.printStackTrace();
} catch (SftpException e)
{
e.printStackTrace();
} catch(FileNotFoundException e)
{
e.printStackTrace();
}
}
}
thanks in advance
Edited by: sabre150 on 19-Jan-2011 02:07
Moderator action : added [ code] tags to improve readability.