Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -356,17 +356,17 @@ public FileSystem create(URI fsUri) throws IOException {
// Validate part size: S3 requires minimum 5MB and maximum 5GB per part
Preconditions.checkArgument(
s3minPartSize >= S3_MULTIPART_MIN_PART_SIZE,
"%s must be at least 5MB (5242880 bytes), but was %d bytes",
"%s must be at least 5MB (5242880 bytes), but was %s bytes",
PART_UPLOAD_MIN_SIZE.key(),
s3minPartSize);
Preconditions.checkArgument(
s3minPartSize <= 5L * 1024 * 1024 * 1024,
"%s must not exceed 5GB (5368709120 bytes), but was %d bytes",
"%s must not exceed 5GB (5368709120 bytes), but was %s bytes",
PART_UPLOAD_MIN_SIZE.key(),
s3minPartSize);
Preconditions.checkArgument(
maxConcurrentUploads > 0,
"%s must be positive, but was %d",
"%s must be positive, but was %s",
MAX_CONCURRENT_UPLOADS.key(),
maxConcurrentUploads);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ void testPartSizeTooSmallThrowsException() {
config.set(NativeS3FileSystemFactory.PART_UPLOAD_MIN_SIZE, 1024L);
assertThatThrownBy(() -> createFs(config))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("must be at least");
.hasMessage(
"s3.upload.min.part.size must be at least 5MB (5242880 bytes), but was 1024 bytes");
}

@Test
Expand All @@ -229,7 +230,8 @@ void testPartSizeTooLargeThrowsException() {
config.set(NativeS3FileSystemFactory.PART_UPLOAD_MIN_SIZE, 6L * 1024 * 1024 * 1024);
assertThatThrownBy(() -> createFs(config))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("must not exceed 5GB");
.hasMessage(
"s3.upload.min.part.size must not exceed 5GB (5368709120 bytes), but was 6442450944 bytes");
}

// --- Max concurrent uploads ---
Expand All @@ -240,7 +242,7 @@ void testInvalidMaxConcurrentUploadsThrowsException() {
config.set(NativeS3FileSystemFactory.MAX_CONCURRENT_UPLOADS, 0);
assertThatThrownBy(() -> createFs(config))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageContaining("must be positive");
.hasMessage("s3.upload.max.concurrent.uploads must be positive, but was 0");
}

// --- Entropy injection ---
Expand Down