public void shutdown() { try { this.s3.stop(); } catch (IOException | InterruptedException | TimeoutException e) { return; } } }
public S3MockClientFactory(int port, String username, String pass) { try { this.s3.start(port, username, pass); } catch (IOException | InterruptedException | InvalidExitValueException | TimeoutException e) { throw new RuntimeException(e); } BasicAWSCredentials awsCredentials = new BasicAWSCredentials(username, pass); this.client = new AmazonS3Client(awsCredentials, new ClientConfiguration()); this.client.setEndpoint("http://127.0.0.1:" + port); this.client.createBucket(S3_BUCKET); }