// copy file to dir
if (command.equals("cftd")) {
wlPanel panel = (wlPanel) cmd.firstElement();
cmd.removeElementAt(0);
try {
Transfer transfer = (Transfer) cmd.firstElement();
cmd.removeElementAt(0);
FtpFile file = transfer.getSource();
FtpFile to = transfer.getDest();
// if dir add files in dir to queue
if (file.isDirectory()) {
new File(to.getAbsolutePath()).mkdir();
frame.getQueueList().removeFirst();
frame.getQueueList().updateView();
FtpFile[] files = file.list();
for (int i = files.length - 1; i >= 0; i--) {
FtpFile tmp = new FtpFile(files[i].getName());
tmp.setFtpMode(false);
tmp.setAbsolutePath(to.getAbsolutePath() + File.separator + files[i].getName());
frame.getQueueList().addAtBegin(new Transfer(files[i], tmp, transfer.modeFrom, transfer.modeTo, transfer.from_to, null, null));
}
// copy the file
} else {
copyFileToDir(file, to, panel);
frame.getQueueList().removeFirst();