//System.out.println("downloadDir: " + dir + "," + out);
fileCount = 0;
shortProgress = true;
baseFile = StringUtils.getDir(dir);
SftpFile f2 = sftp.openDirectory(dir);
Vector v = new Vector();
while(sftp.listChildren(f2, v) > 0)
{
;
}
String[] tmp = new String[v.size()];
SftpFile[] f = new SftpFile[v.size()];
Enumeration e = v.elements();
int x = 0;
while(e.hasMoreElements())
{
f[x] = ((SftpFile) e.nextElement());
tmp[x] = f[x].getFilename();
Log.debugRaw(".");
if(f[x].isDirectory() && !tmp[x].endsWith("/"))
{
tmp[x] = tmp[x] + "/";
}
//sftp.closeFile(f[x]);
x++;
}
//sftp.closeFile(f2);
File fx = new File(out);
fx.mkdir();
for(int i = 0; i < tmp.length; i++)
{
if(tmp[i].equals("./") || tmp[i].equals("../"))
{
continue;
}
tmp[i] = tmp[i].replace('\\', '/');
//System.out.println("1: " + dir+tmp[i] + ", " + out +tmp[i]);
SftpFile f3 = sftp.openFile(dir + tmp[i], R);
if(f3.isDirectory())
{
if(!tmp[i].endsWith("/"))
{
tmp[i] = tmp[i] + "/";
}