Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. String hostname = "10.10.1.2";
  2. String username = "myuser";
  3. String password = "mypass";
  4.  
  5. String remoteFile = "/path/to/my/file.txt";
  6. String localDir = "/path/to/my/destination";
  7.  
  8. Connection conn = new Connection(hostname);
  9. conn.connect();
  10. conn.authenticateWithPassword(username, password);
  11. SCPClient scp = conn.createSCPClient();
  12. scp.put(remoteFile, 2815, localDir, "0644");
  13.  
  14. // And here's where I'm confused.
  15.  
  16. conn.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement