https://docs.aws.amazon.com/ja_jp/AmazonS3/latest/dev/HLuploadFileJava.html Beschreibt das Hochladen von Dateien in S3.
Wenn Sie hier jedoch am Ende des Prozesses nicht shutdownNow aufrufen, scheint der Thread von s3Client weiterhin bestehen zu bleiben. (Vielleicht hängt es von der SDK-Version ab.)
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
.withRegion(clientRegion)
.withCredentials(new ProfileCredentialsProvider())
.build();
TransferManager tm = TransferManagerBuilder.standard()
.withS3Client(s3Client)
.build();
// TransferManager processes all transfers asynchronously,
// so this call returns immediately.
Upload upload = tm.upload(bucketName, keyName, new File(filePath));
System.out.println("Object upload started");
// Optionally, wait for the upload to finish before continuing.
upload.waitForCompletion();
System.out.println("Object upload complete");
// Sie müssen den Transfer Manager wie folgt schließen. tm.shutdownNow();
Referenz
https://www.tcmobile.jp/dev_blog/programming/%E3%80%90java%E3%80%91cse%E3%83%9E%E3%83%AB%E3%83%81%E3%83%91%E3%83%BC%E3%83%88%E3%82%A2%E3%83%83%E3%83%97%E3%83%AD%E3%83%BC%E3%83%89%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%80%81s3%E3%81%B8/
Recommended Posts