@@ -95,9 +95,17 @@ public class S3NioSpiConfiguration extends HashMap<String, Object> {
95
95
*/
96
96
public static final Long S3_SPI_TIMEOUT_HIGH_DEFAULT = TimeOutUtils .TIMEOUT_TIME_LENGTH_5 ;
97
97
/**
98
- * The default value of the credentials property
98
+ * The name of the credentials property
99
99
*/
100
100
public static final String S3_SPI_CREDENTIALS_PROPERTY = "s3.spi.credentials" ;
101
+ /**
102
+ * The name of the S3 object integrity check property
103
+ */
104
+ public static final String S3_INTEGRITY_CHECK_ALGORITHM_PROPERTY = "s3.integrity-check-algorithm" ;
105
+ /**
106
+ * The default value of the S3 object integrity check property
107
+ */
108
+ public static final String S3_INTEGRITY_CHECK_ALGORITHM_DEFAULT = "disabled" ;
101
109
102
110
private static final Pattern ENDPOINT_REGEXP = Pattern .compile ("(\\ w[\\ w\\ -\\ .]*)?(:(\\ d+))?" );
103
111
@@ -131,6 +139,7 @@ public S3NioSpiConfiguration(Map<String, ?> overrides) {
131
139
put (S3_SPI_TIMEOUT_LOW_PROPERTY , String .valueOf (S3_SPI_TIMEOUT_LOW_DEFAULT ));
132
140
put (S3_SPI_TIMEOUT_MEDIUM_PROPERTY , String .valueOf (S3_SPI_TIMEOUT_MEDIUM_DEFAULT ));
133
141
put (S3_SPI_TIMEOUT_HIGH_PROPERTY , String .valueOf (S3_SPI_TIMEOUT_HIGH_DEFAULT ));
142
+ put (S3_INTEGRITY_CHECK_ALGORITHM_PROPERTY , S3_INTEGRITY_CHECK_ALGORITHM_DEFAULT );
134
143
135
144
//
136
145
// With the below we pick existing environment variables and system
@@ -382,6 +391,22 @@ public S3NioSpiConfiguration withTimeoutHigh(Long timeoutHigh) {
382
391
return this ;
383
392
}
384
393
394
+ /**
395
+ * Get the value of the Integrity Check Algorithm
396
+ *
397
+ * @param algorithm the new value; can be null
398
+ * @return this instance
399
+ */
400
+ public S3NioSpiConfiguration withIntegrityCheckAlgorithm (String algorithm ) {
401
+ if (algorithm == null ) {
402
+ put (S3_INTEGRITY_CHECK_ALGORITHM_PROPERTY , S3_INTEGRITY_CHECK_ALGORITHM_DEFAULT );
403
+ } else {
404
+ put (S3_INTEGRITY_CHECK_ALGORITHM_PROPERTY , algorithm );
405
+ }
406
+
407
+ return this ;
408
+ }
409
+
385
410
/**
386
411
* Get the value of the Maximum Fragment Size
387
412
*
@@ -511,6 +536,15 @@ public Long getTimeoutHigh() {
511
536
String .valueOf (S3_SPI_TIMEOUT_HIGH_DEFAULT )));
512
537
}
513
538
539
+ /**
540
+ * Get the value of the Integrity Check Algorithm
541
+ *
542
+ * @return the configured value or the default if not overridden
543
+ */
544
+ public String getIntegrityCheckAlgorithm () {
545
+ return (String ) getOrDefault (S3_INTEGRITY_CHECK_ALGORITHM_PROPERTY , S3_INTEGRITY_CHECK_ALGORITHM_DEFAULT );
546
+ }
547
+
514
548
/**
515
549
* Generates an environment variable name from a property name. E.g 'some.property' becomes 'SOME_PROPERTY'
516
550
*
0 commit comments