org.apache.commons.net.ftp.FTPClient获取Solaris系统FTP文件列表问题 本帖最后由 hxj1225 于 2010-07-05 11:36:18 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试添加下面的代码FTPClientConfig config=new FTPClientConfig();config.setServerLanguageCode(FTPClientConfig.SYST_UNIX);ftpClient=new FTPClient();ftpClient.configure(config); 有没有相关权限,现在命令行ftp看看能取到列表不, public List getFilenameList(String remotePath) throws IOException { ftpClient.binary(); TelnetInputStream tis = null; try { tis = ftpClient.nameList(remotePath); } catch (IOException e) { throw new IOException("路径下已经没有文件"); } BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(tis)); List filenameList = new ArrayList(); String filename = ""; while ((filename = bufferedReader.readLine()) != null) { filenameList.add(filename); } return filenameList; }换成sun的ftp包就可以 java读取word文档 如何将Map集合转换成二维数组? jsp写入sql server乱码问题 FomulaOne往Excel中写数据时,某单元格文本过长无法全部显示 请问如何判断一个字符串是否为另一个的子串? 特殊字符的显示 有一些问题想请教一下各位大虾,请各位回答时尽量具体点哦!有很多分哦! 为什么我做的JSplitPane拖到一定程度就不能再拖动了? 请问什么地方能够找到JBUILDER 8.0 ENTERPRISE EDITION 的注册机器? 能在application程序中用Graphics 吗? 流中的字符编码 jacob无法调用部分COM组件接口
config.setServerLanguageCode(FTPClientConfig.SYST_UNIX);
ftpClient=new FTPClient();
ftpClient.configure(config);
public List getFilenameList(String remotePath) throws IOException {
ftpClient.binary();
TelnetInputStream tis = null;
try {
tis = ftpClient.nameList(remotePath);
} catch (IOException e) {
throw new IOException("路径下已经没有文件");
}
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(tis));
List filenameList = new ArrayList();
String filename = "";
while ((filename = bufferedReader.readLine()) != null) {
filenameList.add(filename);
}
return filenameList;
}
换成sun的ftp包就可以