ftp上传文件失败,求大神解救
public List<File> upload(List<File> files) {
// TODO Auto-generated method stub
//读取配置
InputStream in = getClass().getResourceAsStream(
"/config/jdbc.properties");
Properties prop = new Properties();
List<File> list = new ArrayList<File>();
try {
prop.load(in);
FileInputStream input = null;
String path = prop.getProperty("sanfang.report.temp");
System.out.println("444444------" + ftpClient);
for (File f : files) {
ftpClient.changeWorkingDirectory(path);
input = new FileInputStream(f);
Logger.info(f.getName() + "开始上传........");
ftpClient.enterLocalPassiveMode();
System.out.println(f.getName());
Boolean bool = ftpClient.storeFile(f.getName(), input);
if (bool == true) {
Logger.info(f.getName() + "上传成功");
} else {
list.add(f);
System.out.println("上传失败" + bool);
}
}
if (input != null) {
input.close();
}
} catch (SocketException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
上传一直失败,也没有报错,百度了半天也没找到解决办法,求大神解救啊