595z6j5m75 发表于 2016-6-9 08:43:19

apache FTP操作,获取InputStream

  具体可参考FileAction里面的封装:
  FTPClient fc = new FTPClient();
  fc.connect(path,url);
  fc.login(username,password;
  fc.enterLocalPassiveMode();
  fc.setFileType(FTPClient.BINARY_FILE_TYPE);
  
  int reply = fc.getReplyCode();
  if (!FTPReply.isPositiveCompletion(reply)) {
  fc.disconnect();
  return;
  }
  fc.changeWorkingDirectory(path);
  //xlsInputStream  = fc.getInputStream(); //这个方式获取不到
  xlsInputStream = fc.retrieveFileStream(path);
  fc.disconnect();
页: [1]
查看完整版本: apache FTP操作,获取InputStream