11111
parent
3f4b7ff729
commit
1eead15cc6
|
@ -9,6 +9,7 @@ import com.aliyun.oss.model.OSSObjectSummary;
|
|||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -26,6 +27,7 @@ import java.io.IOException;
|
|||
* 实现项目启动时,把文件下载到服务器里
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
public class DownloadOss implements ApplicationRunner {
|
||||
|
||||
private static final String endPoint = "oss-cn-beijing.aliyuncs.com";
|
||||
|
@ -43,7 +45,6 @@ private static String serverPath ="home/code/";
|
|||
OSS ossClient = new OSSClientBuilder().build(endPoint, accessKeyId, accessKeySecret);
|
||||
try {
|
||||
|
||||
|
||||
//获取所有的oss存储的信息
|
||||
ObjectListing objectListing = ossClient.listObjects(bucketName);
|
||||
|
||||
|
@ -64,8 +65,6 @@ try {
|
|||
|
||||
private static void downloadFile(OSS ossClient, String bucketName, String key, String serverPath){
|
||||
|
||||
|
||||
|
||||
//创建服务器项目容器的文件目录路径
|
||||
File serverFile = new File(serverPath, key);
|
||||
//如果目录不存在,则创建目录
|
||||
|
@ -88,9 +87,6 @@ private static void downloadFile(OSS ossClient, String bucketName, String key, S
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.util.Set;
|
|||
* @name:ENGINE_ROW_HANG_R1
|
||||
* @Date:2024/8/30 11:13
|
||||
*/
|
||||
|
||||
public class ENGINE_DataSet_asdf_S1 extends DataEngineDataSetActuator {
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue