Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesRabauer committed Jan 31, 2024
1 parent 34c9af0 commit 808f421
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ The connector works virtually identical to the [AWS S3 Connector](https://docs.e

## Supported EclipseStore versions

The connector supports [version 1.0.0 of the EclipseStore](https://central.sonatype.com/artifact/org.eclipse.store/storage-embedded/01.00.00).
The connector
supports [version 1.1.0 of the EclipseStore](https://central.sonatype.com/artifact/org.eclipse.store/storage-embedded/01.01.00).

If you are using a different, not listed version of EclipseStore, this shouldn't be a problem.
Usually you can simply exclude the dependent version of EclipseStore.

## Support

If you need support as soon as possible and you can't wait for any pull request, feel free to
If you need support as soon as possible, and you can't wait for any pull request, feel free to
use [our support](https://xdev.software/en/services/support).

## Contributing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,21 @@ public static void main(final String[] args)
public static EmbeddedStorageManager getStorageManager(final Object root)
{
final AmazonS3 client = createClient(COS_API_KEY_ID, COS_SERVICE_CRN, COS_ENDPOINT, COS_BUCKET_LOCATION);

LOG.info("Start creating file system");
final BlobStoreFileSystem cloudFileSystem = BlobStoreFileSystem.New(
// use caching connector
CosConnector.Caching(client)
);
LOG.info("Finished creating file system");

return EmbeddedStorage.start(
LOG.info("Starting storage manager");
final EmbeddedStorageManager storageManager = EmbeddedStorage.start(
root,
cloudFileSystem.ensureDirectoryPath(BUCKET_NAME));
LOG.info("Finished storage manager");

return storageManager;
}

public static AmazonS3 createClient(
Expand All @@ -70,16 +77,19 @@ public static AmazonS3 createClient(
final String endpointUrl,
final String location)
{
LOG.info("Start creating client");
final AWSCredentials credentials = new BasicIBMOAuthCredentials(apiKey, serviceInstanceId);
final ClientConfiguration clientConfig = new ClientConfiguration().withRequestTimeout(-1);
clientConfig.setUseTcpKeepAlive(true);

return AmazonS3ClientBuilder.standard()
final AmazonS3 build = AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpointUrl, location))
.withPathStyleAccessEnabled(true)
.withClientConfiguration(clientConfig)
.build();
LOG.info("Finished creating client");
return build;
}

private App()
Expand Down

0 comments on commit 808f421

Please sign in to comment.