// so you can not rely on returned list for these operations.
NDFSFile[] nfiles = new NDFSFile[files.length];
for (int i = 0; i < files.length; i++) {
long len = files[i].length();
UTF8 name = new UTF8(files[i].toString());
NDFSFileInfo info = new NDFSFileInfo(name, len, len, files[i].isDirectory());
nfiles[i] = new NDFSFile(info);
}
return nfiles;
}