I have an application here in Java that uses the Amazon SDK to send images to an S3 bucket.
To do this I use threads, basically it is modeled as follows:
The Mai
n class has a list of threads and each list item is sent to an Executing class and it calls a Callable
class that downloads an image and returns the image information to the uploader of the image.
The problem that every time I send the image I have to connect to the bucket. See:
BasicAWSCredentials credentials = new BasicAWSCredentials("Usuario", "Senha");
AmazonS3 s3client = AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(credentials))
.withRegion(Regions.US_EAST_1).build();
Does anyone know how to instantiate these connection objects in Main
when I get to Executor
when sending I'm already logged in?