| | |
| | | this.baseMapper = baseMapper; |
| | | } |
| | | |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | // @Scheduled(cron = "0 0/1 * * * ?") |
| | | public void get() throws IOException { |
| | | System.out.println("同步上传......"); |
| | | |
| | |
| | | return; |
| | | } |
| | | for (String str : list) { |
| | | //密码 |
| | | String password = str.substring(0,6); |
| | | //文件名称 |
| | | String fileName = str.substring(6,str.length()); |
| | | String password = str.substring(0, 6); |
| | | String fileName = str.substring(6, str.length()); |
| | | InputStream input = FtpApche.downloadFileFromDailyDir(str); |
| | | byte[] fileBytesByName = FtpApche.getFileBytesByName(input); |
| | | OssClient storage = OssFactory.instance(); |
| | | MultipartFile file = new MockMultipartFile(fileName,fileName, fileName.substring(14,fileName.length()), input); |
| | | // UploadResult uploadResult = storage.upload(input,getPath(fileName),"multipart/form-data; charset=ISO-8859-1"); |
| | | UploadResult uploadResult; |
| | | // try { |
| | | uploadResult = storage.uploadSuffix2(fileBytesByName, getPath(fileName), "multipart/form-data; charset=ISO-8859-1"); |
| | | |
| | | MockMultipartFile mockMultipartFile = new MockMultipartFile(fileName, fileName, fileName.substring(14, fileName.length()), input); |
| | | UploadResult uploadResult = storage.uploadSuffix2(fileBytesByName, getPath(fileName), "multipart/form-data; charset=ISO-8859-1"); |
| | | FtpApche.deleteFile(str); |
| | | input.close(); |
| | | // buildResultEntity(fileName, fileName.substring(14,fileName.length()), "minio", uploadResult, file, |
| | | // password, fileBytesByName); |
| | | |
| | | buildResultEntity(fileName, fileName.substring(14, fileName.length()), "minio", uploadResult, (MultipartFile)mockMultipartFile, password, fileBytesByName); |
| | | } |
| | | |
| | | } |