Search in sources :

Example 6 with Stream

use of com.amazonaws.services.dynamodbv2.model.Stream in project tutorials by eugenp.

the class ProductInfoRepositoryIntegrationTest method loadFromFileInClasspath.

private static Optional<Properties> loadFromFileInClasspath(String fileName) {
    InputStream stream = null;
    try {
        Properties config = new Properties();
        Path configLocation = Paths.get(ClassLoader.getSystemResource(fileName).toURI());
        stream = Files.newInputStream(configLocation);
        config.load(stream);
        return Optional.of(config);
    } catch (Exception e) {
        return Optional.empty();
    } finally {
        if (stream != null) {
            try {
                stream.close();
            } catch (IOException e) {
            }
        }
    }
}
Also used : Path(java.nio.file.Path) InputStream(java.io.InputStream) IOException(java.io.IOException) Properties(java.util.Properties) ResourceInUseException(com.amazonaws.services.dynamodbv2.model.ResourceInUseException) URISyntaxException(java.net.URISyntaxException) IOException(java.io.IOException)

Aggregations

DescribeStreamRequest (com.amazonaws.services.dynamodbv2.model.DescribeStreamRequest)3 DescribeStreamResult (com.amazonaws.services.dynamodbv2.model.DescribeStreamResult)3 GetShardIteratorResult (com.amazonaws.services.dynamodbv2.model.GetShardIteratorResult)3 AmazonDynamoDB (com.amazonaws.services.dynamodbv2.AmazonDynamoDB)2 GetShardIteratorRequest (com.amazonaws.services.dynamodbv2.model.GetShardIteratorRequest)2 ListStreamsRequest (com.amazonaws.services.dynamodbv2.model.ListStreamsRequest)2 ListStreamsResult (com.amazonaws.services.dynamodbv2.model.ListStreamsResult)2 IOException (java.io.IOException)2 AmazonClientException (com.amazonaws.AmazonClientException)1 DefaultAWSCredentialsProviderChain (com.amazonaws.auth.DefaultAWSCredentialsProviderChain)1 AmazonDynamoDBStreams (com.amazonaws.services.dynamodbv2.AmazonDynamoDBStreams)1 AttributeDefinition (com.amazonaws.services.dynamodbv2.model.AttributeDefinition)1 AttributeValue (com.amazonaws.services.dynamodbv2.model.AttributeValue)1 AttributeValueUpdate (com.amazonaws.services.dynamodbv2.model.AttributeValueUpdate)1 CreateTableRequest (com.amazonaws.services.dynamodbv2.model.CreateTableRequest)1 DescribeTableResult (com.amazonaws.services.dynamodbv2.model.DescribeTableResult)1 GetRecordsRequest (com.amazonaws.services.dynamodbv2.model.GetRecordsRequest)1 GetRecordsResult (com.amazonaws.services.dynamodbv2.model.GetRecordsResult)1 KeySchemaElement (com.amazonaws.services.dynamodbv2.model.KeySchemaElement)1 ProvisionedThroughput (com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput)1