| | |
| | | package com.dji.sample.media.util; |
| | | |
| | | import com.dji.sample.patches.utils.TimerUtil; |
| | | import io.minio.MinioClient; |
| | | import io.minio.RemoveObjectArgs; |
| | | import io.minio.StatObjectArgs; |
| | |
| | | this.bucketPath = bucketPath; |
| | | } |
| | | |
| | | public void downloadAndZipFolders(List<String> prefixes, String localSaveDir,String filepath) throws Exception { |
| | | public void downloadAndZipFolders(List<String> prefixes, String localSaveDir,String time) throws Exception { |
| | | // 创建目标文件夹路径并生成zip文件名 |
| | | Path localSavePath = Paths.get(localSaveDir); |
| | | if (!Files.exists(localSavePath)) { |
| | | Files.createDirectories(localSavePath); |
| | | } |
| | | String zipFileName = localSavePath.resolve(filepath).toString(); |
| | | String zipFileName = localSavePath.resolve(time).toString(); |
| | | |
| | | // 创建压缩文件输出流 |
| | | try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFileName))) { |