Channel channel = openExecChannel("scp -d -t " + remotePath);
try {
OutputStream out = channel.getOutputStream();
InputStream in = channel.getInputStream();
channel.connect();
waitForAck(in);
for (Iterator i = directoryList.iterator(); i.hasNext();) {
Directory current = (Directory) i.next();
sendDirectory(current, in, out);