FTPClient类的listFile()卡住了,啥原因啊 5
publicstaticVector<String>getFileListOfFtp(FTPClientftpClient){Vector<String>result=n...
public static Vector<String> getFileListOfFtp(FTPClient ftpClient) {
Vector<String> result = new Vector<String>();
String[] suffixs = FORMAT.split(",");
FTPFile[] files = null;
String fileName = "";
try {
// 循环后缀过滤文件
for (int i = 0; i < suffixs.length; i++) {
files = ftpClient.listFiles(suffixs[i]);
if (null != files) {
for (int j = 0; j < files.length; j++) {
fileName = decode(files[j].getName());
result.add(fileName);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return result;
} 展开
Vector<String> result = new Vector<String>();
String[] suffixs = FORMAT.split(",");
FTPFile[] files = null;
String fileName = "";
try {
// 循环后缀过滤文件
for (int i = 0; i < suffixs.length; i++) {
files = ftpClient.listFiles(suffixs[i]);
if (null != files) {
for (int j = 0; j < files.length; j++) {
fileName = decode(files[j].getName());
result.add(fileName);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
return result;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询