cy
2022-10-11 64670dc728cf83a047e8773835937b842d5535ed
recommend-video/src/main/java/com/iplatform/recvideo/util/SFTPUtil.java
@@ -221,10 +221,26 @@
        if (!parentFile.exists()) {
            parentFile.mkdirs();
        }
        sftp.get(downloadFile, new FileOutputStream(file));
        log.info("file:{} is download successful", downloadFile);
        if (isExistSftp(downloadFile)) {
            sftp.get(downloadFile, new FileOutputStream(file));
            log.info("file:{} is download successful", downloadFile);
        } else {
            log.error("file:{} is not found", downloadFile);
        }
    }
    // 判断文件是否存在
    public boolean isExistSftp(String filePach) {
        try {
            sftp.lstat(filePach);
        } catch (SftpException e) {
            log.info("isExistSftp()==> file:{} is not found", filePach);
            return false;
        }
        return true;
    }
    /**
     * 下载文件
     *