File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
local-s3-interationtest/src/test/java/com/robothy/s3/test
local-s3-jupiter/src/main/java/com/robothy/s3/jupiter/extensions
local-s3-rest/src/main/java/com/robothy/s3/rest Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1
1
package com .robothy .s3 .test ;
2
2
3
3
import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
4
+
5
+ import com .amazonaws .auth .AWSStaticCredentialsProvider ;
6
+ import com .amazonaws .auth .BasicAWSCredentials ;
4
7
import com .amazonaws .client .builder .AwsClientBuilder ;
5
8
import com .amazonaws .services .s3 .AmazonS3 ;
6
9
import com .amazonaws .services .s3 .AmazonS3ClientBuilder ;
7
10
import com .amazonaws .services .s3 .model .HeadBucketRequest ;
8
- import com .amazonaws .services .s3 .transfer .TransferManagerBuilder ;
9
11
import com .robothy .s3 .rest .LocalS3 ;
10
12
import com .robothy .s3 .rest .bootstrap .LocalS3Mode ;
11
13
import java .io .IOException ;
@@ -55,6 +57,7 @@ void test() throws IOException {
55
57
AmazonS3 createClient (int port ) {
56
58
return AmazonS3ClientBuilder .standard ().withEndpointConfiguration (
57
59
new AwsClientBuilder .EndpointConfiguration ("http://localhost:" + port , "local" ))
60
+ .withCredentials (new AWSStaticCredentialsProvider (new BasicAWSCredentials ("foo" , "bar" )))
58
61
.enablePathStyleAccess ()
59
62
.build ();
60
63
}
Original file line number Diff line number Diff line change 1
1
package com .robothy .s3 .jupiter .extensions ;
2
2
3
3
import com .amazonaws .ClientConfiguration ;
4
+ import com .amazonaws .auth .AWSStaticCredentialsProvider ;
5
+ import com .amazonaws .auth .BasicAWSCredentials ;
4
6
import com .amazonaws .client .builder .AwsClientBuilder ;
5
7
import com .amazonaws .services .s3 .AmazonS3 ;
6
8
import com .amazonaws .services .s3 .AmazonS3Client ;
@@ -13,6 +15,7 @@ public class AmazonS3Resolver extends AbstractLocalS3ParameterResolver {
13
15
14
16
private final AmazonS3ClientBuilder s3Builder = AmazonS3Client .builder ()
15
17
.enablePathStyleAccess ()
18
+ .withCredentials (new AWSStaticCredentialsProvider (new BasicAWSCredentials ("local-s3-access-key" , "local-s3-secret-key" )))
16
19
.withClientConfiguration (new ClientConfiguration ()
17
20
.withConnectionTimeout (1000 )
18
21
.withSocketTimeout (1000 ));
Original file line number Diff line number Diff line change @@ -149,17 +149,17 @@ public void shutdown() {
149
149
}
150
150
151
151
private void shutdownEventExecutorsGroupIfNeeded (EventExecutorGroup ... eventExecutorsList ) {
152
+ boolean shutdownPerformed = false ;
152
153
for (EventExecutorGroup eventExecutors : eventExecutorsList ) {
153
154
if (!eventExecutors .isShuttingDown () && !eventExecutors .isShutdown ()) {
154
- try {
155
- eventExecutors .shutdownGracefully ().sync ();
156
- } catch (InterruptedException e ) {
157
- throw new RuntimeException (e );
158
- }
155
+ shutdownPerformed = true ;
156
+ eventExecutors .shutdownGracefully ();
159
157
}
160
158
}
161
159
162
- log .info ("LocalS3 stopped." );
160
+ if (shutdownPerformed ) {
161
+ log .info ("LocalS3 stopped." );
162
+ }
163
163
}
164
164
165
165
/**
You can’t perform that action at this time.
0 commit comments