还是FTP客户端问题
private void download_actionPerformed(ActionEvent e) {System.out.println("下载");
upload.setEnabled(true);
String[] filenames = listServer.getSelectedItems();
for(int i=0; i < filenames.length;i++) {
String filename = filenames[i];
System.out.println(filename);
int ch;
try {
String str = path + "\\" + filename;
File localFile = new File(str);
System.out.println(str);
RandomAccessFile getFile = new RandomAccessFile(str,"rw");
getFile.seek(0);
System.out.println("ttt");
TelnetInputStream ins = ftp.get(filename);
System.out.println("fdss");
System.out.println(ins);
DataInputStream inputs = new DataInputStream(ins);
while((ch =inputs.read()) >= 0) {
getFile.write(ch);
}
ins.close();
getFile.close();
}
catch (IOException ex) {
ex.printStackTrace();
}
}
}
程序总是运行到TelnetInputStream ins = ftp.get(filename);卡死,下载到本地的文件只有文件名,大小为0;
菜鸟求指教!!跪求大神!!