@Override
public SOSFileList dir(String pathname, int flag) {
@SuppressWarnings("unused")
final String conMethodName = conClassName + "::dir";
SOSFileList fileList = new SOSFileList();
FTPFile[] listFiles = null;
try {
listFiles = Client().listFiles(pathname);
}
catch (IOException e) {
RaiseException(e, HostID(String.format(objMsg.getMsg(SOSVfs_E_0105), conMethodName)));
}
for (int i = 0; i < listFiles.length; i++) {
if (flag > 0 && listFiles[i].isDirectory()) {
fileList.addAll(this.dir(pathname + "/" + listFiles[i].toString(), ((flag >= 1024) ? flag : flag + 1024)));
}
else {
if (flag >= 1024) {
fileList.add(pathname + "/" + listFiles[i].toString());
}
else {
fileList.add(listFiles[i].toString());
}
}
}
return fileList;
}