这是第一次针对文件以及对象存储的使用,写个案例,设计如有不妥之处,多多指教
首先,我们引入依赖包
<!--aws sdk-->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.11.136</version>
</dependency>
<!--解压 rar包 工具-->
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>4.0.0</version>
</dependency>
S3工具
import com.amazonaws.ClientConfigurationFactory;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.regions.*;;
import com.amazonaws.services.s3.*;
import com.amazonaws.services.s3.model.*;
import com.amazonaws.services.s3.transfer.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
/**
* @ClassName S3AutoConfiguration
* @Desc S3配置
* @Author Fyf
* @Date 2020/3/13 9:29
* @Version 1.0
**/
@Lazy
@Component
public class