master
zhang chengzhi 2024-09-04 14:49:39 +08:00
parent 2fe22d4672
commit d0012fadf8
2 changed files with 9 additions and 8 deletions

View File

@ -46,14 +46,11 @@ private static String serverPath ="home/source/";
// 获取存储桶信息
ObjectListing objectListing = ossClient.listObjects(bucketName);
// 循环获取存储桶中的所有对象
for (OSSObjectSummary objectSummary : objectListing.getObjectSummaries()) {
String key = objectSummary.getKey();
downloadFile(ossClient, bucketName, key, serverPath);
}
// 关闭OSSClient
ossClient.shutdown();
}
@ -66,7 +63,6 @@ private void downloadFile(OSS ossClient, String bucketName, String key, String
if (!serverFile.getParentFile().exists()){
serverFile.getParentFile().mkdirs();
}
//下载文件到项目中
OSSObject ossObject = ossClient.getObject(new GetObjectRequest(bucketName, key));
@ -81,7 +77,6 @@ private void downloadFile(OSS ossClient, String bucketName, String key, String
log.error("下载文件失败:"+key);
e.printStackTrace();
}
}
}

View File

@ -35,16 +35,22 @@ public class EngineConfig {
*/
private String localTarget ="D:\\config\\engine\\target\\";
/**
*
*/
private static String serverPath ="home/source/";
/**
*
*/
private static String ClassPath ="home/class/";
/**
*
* @return
*/
//private String serverPath = "home/";
private String serverPath = "home/";
// private String serverPath = "home/config/source/";
/**