| | |
| | | return false; |
| | | } |
| | | |
| | | ftp.enterLocalActiveMode(); |
| | | //主动模式 |
| | | // ftp.enterLocalActiveMode(); |
| | | |
| | | // 设置文件类型为二进制,与ASCII有区别 |
| | | ftp.setFileType(FTP.BINARY_FILE_TYPE); |
| | |
| | | // 检验文件是否存在 |
| | | ftp.changeWorkingDirectory(ftpPath); |
| | | |
| | | // Use passive mode as default |
| | | // Use passive mode as default 被动模式 |
| | | ftp.enterLocalPassiveMode(); |
| | | |
| | | FTPFile[] files = ftp.listFiles(); |
| | | if (files.length==0){ |
| | | ftp.logout(); |
| | | return false; |
| | | } |
| | | else { |
| | |
| | | } |
| | | } |
| | | //关闭流 |
| | | ftp.completePendingCommand(); |
| | | ftp.logout(); |
| | | // ftp.completePendingCommand(); |
| | | // ftp.logout(); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("ftp连接失败"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.disconnect(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | ftp.enterLocalActiveMode(); |
| | | // ftp.enterLocalActiveMode(); |
| | | |
| | | // 设置文件类型为二进制,与ASCII有区别 |
| | | ftp.setFileType(FTP.BINARY_FILE_TYPE); |
| | |
| | | //文件个数大于10个时开始处理 |
| | | // if (files.length==0 || files.length<10){ |
| | | if (files.length==0){ |
| | | ftp.logout(); |
| | | // ftp.logout(); |
| | | return false; |
| | | } |
| | | else { |
| | |
| | | } |
| | | } |
| | | //关闭流 |
| | | ftp.completePendingCommand(); |
| | | ftp.logout(); |
| | | // ftp.completePendingCommand(); |
| | | // ftp.logout(); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("ftp连接失败"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.disconnect(); |
| | |
| | | return false; |
| | | } |
| | | |
| | | ftp.enterLocalActiveMode(); |
| | | // ftp.enterLocalActiveMode(); |
| | | |
| | | // 设置文件类型为二进制,与ASCII有区别 |
| | | ftp.setFileType(FTP.BINARY_FILE_TYPE); |
| | |
| | | FTPFile[] files = ftp.listFiles(); |
| | | //文件个数大于10个时开始处理 |
| | | if (files.length==0){ |
| | | ftp.logout(); |
| | | |
| | | return false; |
| | | } |
| | | else { |
| | |
| | | } |
| | | } |
| | | //关闭流 |
| | | ftp.completePendingCommand(); |
| | | ftp.logout(); |
| | | // ftp.completePendingCommand(); |
| | | // ftp.logout(); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("ftp连接失败"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.disconnect(); |
| | |
| | | * 用户集合信息处理 |
| | | * @param result |
| | | */ |
| | | private void userListInfoHandler(Result result) { |
| | | @Async |
| | | public void userListInfoHandler(Result result) { |
| | | //获取 result |
| | | List<Result> data1 = result.getData(); |
| | | System.out.println("批量导入数据 = " + data1); |
| | |
| | | return false; |
| | | } |
| | | |
| | | ftp.enterLocalActiveMode(); |
| | | // ftp.enterLocalActiveMode(); |
| | | |
| | | // 设置文件类型为二进制,与ASCII有区别 |
| | | ftp.setFileType(FTP.BINARY_FILE_TYPE); |
| | |
| | | ftp.setControlEncoding("GBK"); |
| | | |
| | | // 检验文件是否存在 |
| | | ftp.changeWorkingDirectory(ftpPath); |
| | | // ftp.changeWorkingDirectory(ftpPath); |
| | | |
| | | // Use passive mode as default |
| | | ftp.enterLocalPassiveMode(); |
| | |
| | | FTPFile[] files = ftp.listFiles(); |
| | | //文件个数大于10个时开始处理 |
| | | if (files.length==0){ |
| | | ftp.logout(); |
| | | // ftp.logout(); |
| | | return false; |
| | | } |
| | | else { |
| | |
| | | } |
| | | } |
| | | //关闭流 |
| | | ftp.completePendingCommand(); |
| | | ftp.logout(); |
| | | // ftp.completePendingCommand(); |
| | | // ftp.logout(); |
| | | } |
| | | } catch (Exception e) { |
| | | System.out.println("ftp连接失败"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | ftp.logout(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (ftp.isConnected()) { |
| | | try { |
| | | ftp.disconnect(); |
| | |
| | | * 报名信息处理 |
| | | * @param result |
| | | */ |
| | | private void applyHandler(String uuid,Result result) { |
| | | @Async |
| | | public void applyHandler(String uuid,Result result) { |
| | | //取出培训学校id |
| | | //从redis 中获取用户数据 |
| | | String s = redisTemplate.opsForValue().get(uuid).toString(); |