| | |
| | | |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.SerializationFeature; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.core.exception.ServiceException; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.oss.core.OssClient; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class VideoPulSync { |
| | | |
| | |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | public void get() throws IOException { |
| | | System.out.println("同步上传......"); |
| | | |
| | | log.info("同步上传"); |
| | | List<String> list = FtpApche.downloadList(ftpConfig); |
| | | |
| | | if(list.size() == 0){ |
| | | log.error("no files in ftp"); |
| | | System.out.println("ftp get 0 fileinfo"); |
| | | return; |
| | | } |
| | | System.out.println("ftp get all fileinfo:" + list.get(0)); |
| | | for (String str : list) { |
| | | String password = str.substring(0, 6); |
| | | String fileName = str.substring(6, str.length()); |