Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides Amazon S3 patterns and examples using AWS SDK for Java 2.x. Use when working with S3 buckets, uploading/downloading objects, multipart uploads, presigned URLs, S3 Transfer Manager, object operations, or S3-specific configurations.
.claude/skills/giuseppe-trisciuoglio-aws-sdk-java-v2-s3/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-09 | ✗→✓ | ▲ Improved | 53% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 104% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 121% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 45% | 0% |
| case-10 | ✓→✓ | = Same ✓ | 72% | 0% |
Provides patterns for S3 operations: bucket management, object upload/download with multipart support, presigned URLs, S3 Transfer Manager, and S3-specific configurations using AWS SDK for Java 2.x.
| Operation | Method | Notes | |-----------|--------|-------| | Create bucket | createBucket() | Wait with waiter().waitUntilBucketExists() | | Upload object | putObject() | Use RequestBody.fromFile() | | Download object | getObject() | Streams to file or memory | | Delete objects | deleteObjects() | Batch up to 1000 keys | | Presigned URL | presigner.presignGetObject() | Max 7 days expiration |
| Class | Use Case | |-------|----------| | STANDARD | Frequently accessed data | | STANDARD_IA | Infrequently accessed data | | GLACIER | Long-term archive | | INTELLIGENT_TIERING | Automatic cost optimization |
xml<dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>s3</artifactId> <version>2.20.0</version> </dependency> <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>s3-transfer-manager</artifactId> <version>2.20.0</version> </dependency>
javaS3Client s3Client = S3Client.builder() .region(Region.US_EAST_1) .build(); // With retry logic S3Client s3Client = S3Client.builder() .region(Region.US_EAST_1) .overrideConfiguration(b -> b .retryPolicy(RetryPolicy.builder() .numRetries(3) .build())) .build();
javaCreateBucketRequest request = CreateBucketRequest.builder() .bucket(bucketName) .build(); s3Client.createBucket(request); // Wait until ready s3Client.waiter().waitUntilBucketExists( HeadBucketRequest.builder().bucket(bucketName).build() );
javaPutObjectRequest request = PutObjectRequest.builder() .bucket(bucketName) .key(key) .contentType("application/pdf") .serverSideEncryption(ServerSideEncryption.AES256) .storageClass(StorageClass.STANDARD_IA) .build(); s3Client.putObject(request, RequestBody.fromFile(Paths.get(filePath))); // Validate upload completion HeadObjectResponse headResp = s3Client.headObject(HeadObjectRequest.builder() .bucket(bucketName) .key(key) .build());
javaGetObjectRequest request = GetObjectRequest.builder() .bucket(bucketName) .key(key) .build(); s3Client.getObject(request, Paths.get(destPath));
javatry (S3Presigner presigner = S3Presigner.create()) { GetObjectRequest getRequest = GetObjectRequest.builder() .bucket(bucketName) .key(key) .build(); GetObjectPresignRequest presignRequest = GetObjectPresignRequest.builder() .signatureDuration(Duration.ofMinutes(10)) .getObjectRequest(getRequest) .build(); String url = presigner.presignGetObject(presignRequest).url().toString(); }
javatry (S3TransferManager tm = S3TransferManager.create()) { UploadFileRequest request = UploadFileRequest.builder() .putObjectRequest(req -> req.bucket(bucketName).key(key)) .source(Paths.get(filePath)) .build(); FileUpload upload = tm.uploadFile(request); CompletedFileUpload result = upload.completionFuture().join(); }
S3AsyncClient for I/O-bound operationsjava// 1. Upload with validation PutObjectRequest putRequest = PutObjectRequest.builder() .bucket(bucketName) .key(key) .contentType(contentType) .build(); s3Client.putObject(putRequest, RequestBody.fromFile(Paths.get(filePath))); // 2. Validate with headObject HeadObjectResponse headResp = s3Client.headObject(HeadObjectRequest.builder() .bucket(bucketName) .key(key) .build()); // 3. Verify metadata long fileSize = Files.size(Paths.get(filePath)); if (headResp.contentLength() != fileSize) { throw new IllegalStateException("Upload size mismatch"); }
java// 1. Initiate multipart upload CreateMultipartUploadRequest createRequest = CreateMultipartUploadRequest.builder() .bucket(bucketName) .key(key) .build(); CreateMultipartUploadResponse multipartUpload = s3Client.createMultipartUpload(createRequest); String uploadId = multipartUpload.uploadId(); try { // 2. Upload parts List<CompletedPart> parts = new ArrayList<>(); int partNumber = 1; byte[] fileBytes = Files.readAllBytes(Paths.get(filePath)); int chunkSize = 5 * 1024 * 1024; // 5MB minimum for (int offset = 0; offset < fileBytes.length; offset += chunkSize) { int length = Math.min(chunkSize, fileBytes.length - offset); UploadPartRequest uploadPartRequest = UploadPartRequest.builder() .bucket(bucketName) .key(key) .uploadId(uploadId) .partNumber(partNumber) .build(); UploadPartResponse partResponse = s3Client.uploadPart(uploadPartRequest, RequestBody.fromBytes(Arrays.copyOfRange(fileBytes, offset, offset + length))); parts.add(CompletedPart.builder() .partNumber(partNumber) .eTag(partResponse.eTag()) .build()); partNumber++; } // 3. Complete multipart upload CompleteMultipartUploadRequest completeRequest = CompleteMultipartUploadRequest.builder() .bucket(bucketName) .key(key) .uploadId(uploadId) .multipartUpload(CompletedMultipartUpload.builder().parts(parts).build()) .build(); s3Client.completeMultipartUpload(completeRequest); } catch (Exception e) { // 4. Abort on failure AbortMultipartUploadRequest abortRequest = AbortMultipartUploadRequest.builder() .bucket(bucketName) .key(key) .uploadId(uploadId) .build(); s3Client.abortMultipartUpload(abortRequest); throw new RuntimeException("Upload failed, cleanup performed", e); }
aws-sdk-java-v2-core - Core AWS SDK patterns and configurationspring-boot-dependency-injection - Spring dependency injection patterns| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 10,118 | 7,607 | -25% | 1 | 1 | 0% | 1,932 | 3,938 | +104% | 0 | 0 | — |
case-02 | pass→pass | 8,692 | 6,073 | -30% | 1 | 1 | 0% | 1,596 | 3,520 | +121% | 0 | 0 | — |
case-03 | pass→pass | 16,925 | 12,177 | -28% | 1 | 1 | 0% | 3,380 | 4,890 | +45% | 0 | 0 | — |
case-09 | fail→pass | 15,371 | 17,999 | +17% | 1 | 1 | 0% | 3,299 | 5,060 | +53% | 0 | 0 | — |
case-10 | pass→pass | 11,856 | 8,952 | -24% | 1 | 1 | 0% | 2,447 | 4,214 | +72% | 0 | 0 | — |
case-15 | pass→pass | 8,558 | 7,200 | -16% | 1 | 1 | 0% | 1,503 | 3,731 | +148% | 0 | 0 | — |
case-20 | pass→pass | 12,501 | 11,302 | -10% | 1 | 1 | 0% | 2,518 | 4,752 | +89% | 0 | 0 | — |
case-04 | pass→pass | 7,041 | 8,228 | +17% | 1 | 1 | 0% | 1,353 | 4,086 | +202% | 0 | 0 | — |
case-05 | pass→pass | 13,333 | 8,693 | -35% | 1 | 1 | 0% | 2,582 | 4,038 | +56% | 0 | 0 | — |
case-06 | pass→pass | 9,162 | 17,489 | +91% | 1 | 1 | 0% | 1,876 | 4,272 | +128% | 0 | 0 | — |
case-07 | pass→pass | 11,826 | 14,887 | +26% | 1 | 1 | 0% | 2,143 | 4,446 | +107% | 0 | 0 | — |
case-08 | pass→pass | 16,255 | 15,026 | -8% | 1 | 1 | 0% | 3,277 | 5,519 | +68% | 0 | 0 | — |
case-11 | pass→pass | 8,107 | 6,401 | -21% | 1 | 1 | 0% | 1,559 | 3,662 | +135% | 0 | 0 | — |
case-12 | pass→pass | 11,431 | 8,693 | -24% | 1 | 1 | 0% | 2,216 | 3,908 | +76% | 0 | 0 | — |
case-13 | pass→pass | 14,844 | 10,159 | -32% | 1 | 1 | 0% | 2,492 | 4,145 | +66% | 0 | 0 | — |
case-14 | pass→pass | 3,955 | 5,205 | +32% | 1 | 1 | 0% | 747 | 3,401 | +355% | 0 | 0 | — |
case-16 | pass→pass | 11,193 | 8,655 | -23% | 1 | 1 | 0% | 2,114 | 4,108 | +94% | 0 | 0 | — |
case-17 | pass→pass | 11,906 | 10,333 | -13% | 1 | 1 | 0% | 2,269 | 4,335 | +91% | 0 | 0 | — |
case-18 | pass→pass | 8,504 | 8,063 | -5% | 1 | 1 | 0% | 1,458 | 3,880 | +166% | 0 | 0 | — |
case-19 | pass→pass | 10,105 | 5,796 | -43% | 1 | 1 | 0% | 1,971 | 3,448 | +75% | 0 | 0 | — |
case-21 | pass→pass | 10,440 | 6,568 | -37% | 1 | 1 | 0% | 2,102 | 3,691 | +76% | 0 | 0 | — |
case-22 | pass→pass | 8,244 | 8,307 | +1% | 1 | 1 | 0% | 1,695 | 4,103 | +142% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.