Skip to content
Closed
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 @@ -184,6 +184,18 @@ public Response put(
// Normal put object
OzoneBucket bucket = getBucket(bucketName);

// S3A Filesystem when create directory creates a put object with 0 bytes.
// So, we can safely call create directory.
// And also in S3 world, there is no such API to create a directory.
// If some one is passing key with trailing "/" and length 0, Ozone S3
// can create directory.

if (length == 0 && keyPath.endsWith("/")) {
bucket.createDirectory(keyPath);
return Response.ok().status(HttpStatus.SC_OK)
.build();
}

output = bucket.createKey(keyPath, length, replicationType,
replicationFactor, new HashMap<>());

Expand Down