File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
src/main/java/com/spring/loader Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ public class S3PropertyPlaceholderConfigurer extends PropertyPlaceholderConfigur
15
15
private S3ResourceLoader resourceLoader ;
16
16
private String [] s3Locations = new String [0 ];
17
17
private Resource [] conventionalResources = new Resource [0 ];
18
- private boolean ignoreS3resourceNotFound = false ;
19
18
20
19
public S3PropertyPlaceholderConfigurer (S3ResourceLoader resourceLoader ) {
21
20
this .resourceLoader = resourceLoader ;
@@ -42,19 +41,12 @@ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
42
41
}
43
42
44
43
private void injectS3Resources () {
45
-
46
44
int total = conventionalResources .length + s3Locations .length ;
47
45
48
46
if (total > 0 ) {
49
47
List <Resource > allResources = new ArrayList <>();
50
48
for (String s3Location : s3Locations ) {
51
- try {
52
- allResources .add (resourceLoader .getResource (s3Location ));
53
- } catch (S3ResourceException exp ) {
54
- if (!ignoreS3resourceNotFound ) {
55
- throw exp ;
56
- }
57
- }
49
+ allResources .add (resourceLoader .getResource (s3Location ));
58
50
}
59
51
for (Resource conventionalResource : conventionalResources ) {
60
52
allResources .add (conventionalResource );
Original file line number Diff line number Diff line change 9
9
import com .amazonaws .services .s3 .AmazonS3Client ;
10
10
import com .amazonaws .services .s3 .model .S3Object ;
11
11
12
- public class S3ResourceLoader implements ResourceLoader {
12
+ class S3ResourceLoader implements ResourceLoader {
13
13
14
14
private static final String S3_PROTOCOL_PREFIX = "s3://" ;
15
15
16
- private AmazonS3 s3 ;
16
+ private final AmazonS3 s3 ;
17
17
18
18
public S3ResourceLoader (AWSCredentials credentials ) {
19
19
this (new AmazonS3Client (credentials ));
You can’t perform that action at this time.
0 commit comments