26
26
import jakarta .annotation .Nullable ;
27
27
import java .net .URI ;
28
28
import java .util .List ;
29
- import java .util .Optional ;
30
29
import java .util .regex .Matcher ;
31
30
import java .util .regex .Pattern ;
32
31
import org .apache .polaris .core .storage .PolarisStorageConfigurationInfo ;
33
32
34
33
/** Aws Polaris Storage Configuration information */
35
34
public class AwsStorageConfigurationInfo extends PolarisStorageConfigurationInfo {
36
35
36
+ private static final boolean PATH_STYLE_ACCESS_DEFAULT = false ;
37
+
37
38
// Technically, it should be ^arn:(aws|aws-cn|aws-us-gov):iam::(\d{12}):role/.+$,
38
39
@ JsonIgnore
39
40
public static final String ROLE_ARN_PATTERN = "^arn:(aws|aws-us-gov):iam::(\\ d{12}):role/.+$" ;
@@ -84,15 +85,23 @@ public AwsStorageConfigurationInfo(
84
85
this .region = region ;
85
86
this .endpoint = endpoint ;
86
87
this .stsEndpoint = stsEndpoint ;
87
- this .pathStyleAccess = Optional . ofNullable ( pathStyleAccess ). orElse ( false ) ;
88
+ this .pathStyleAccess = pathStyleAccess == null ? PATH_STYLE_ACCESS_DEFAULT : pathStyleAccess ;
88
89
}
89
90
90
91
public AwsStorageConfigurationInfo (
91
92
@ Nonnull StorageType storageType ,
92
93
@ Nonnull List <String > allowedLocations ,
93
94
@ Nonnull String roleARN ,
94
95
@ Nullable String region ) {
95
- this (storageType , allowedLocations , roleARN , null , region , null , null , false );
96
+ this (
97
+ storageType ,
98
+ allowedLocations ,
99
+ roleARN ,
100
+ null ,
101
+ region ,
102
+ null ,
103
+ null ,
104
+ PATH_STYLE_ACCESS_DEFAULT );
96
105
}
97
106
98
107
public AwsStorageConfigurationInfo (
@@ -101,7 +110,15 @@ public AwsStorageConfigurationInfo(
101
110
@ Nonnull String roleARN ,
102
111
@ Nullable String externalId ,
103
112
@ Nullable String region ) {
104
- this (storageType , allowedLocations , roleARN , externalId , region , null , null , false );
113
+ this (
114
+ storageType ,
115
+ allowedLocations ,
116
+ roleARN ,
117
+ externalId ,
118
+ region ,
119
+ null ,
120
+ null ,
121
+ PATH_STYLE_ACCESS_DEFAULT );
105
122
}
106
123
107
124
@ Override
0 commit comments