Advertisement
Guest User

Untitled

a guest
Feb 13th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. public static void main(String[] arg) throws IOException, JSchException {
  2. String remoteA = "/tmp/scp/remote-a/abc.txt";
  3. String remoteB = "/tmp/scp/remote-b/";
  4. String local = "/tmp/scp/local/";
  5.  
  6. String user = "chanaka";
  7. String host = "localhost";
  8. int port = 22;
  9.  
  10. String keyFilePath = "/home/chanaka/.ssh/id_rsa";
  11. String keyPassword = null;
  12.  
  13. Session session = createSession(user, host, port, keyFilePath, keyPassword);
  14.  
  15. copyLocalToRemote(session, remoteA, local);
  16. copyLocalToRemote(session, local + "abc.txt", remoteB);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement