Skip to content

Commit

Permalink
final modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
allenaverbukh committed Jan 30, 2025
1 parent a6f1d10 commit ea23ccc
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,12 @@ private Callback<Long> parseRequestBodyAndDeleteCallback(RetainingAsyncWritableC
// deserialize the xml as deleteRequest
S3MessagePayload.S3BatchDeleteObjects deleteRequest = deserializeRequest(channel);
;

// validate the request for size
if (deleteRequest.getObjects().size() > MAX_BATCH_DELETE_SIZE) {
String batchSizeErrorMessage = "Exceeded Maximum Batch Size of ";
throw new RestServiceException(batchSizeErrorMessage, RestServiceErrorCode.BadRequest);

}

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
RequestPath requestPath = (RequestPath) restRequest.getArgs().get(InternalKeys.REQUEST_PATH);

// create objects for processing the request
Expand Down Expand Up @@ -145,6 +142,7 @@ else if (exception instanceof RestServiceException) {
try {
// construct and serialize response
S3MessagePayload.DeleteResult response = new S3MessagePayload.DeleteResult();
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
response.setDeleted(new ArrayList<>(deleted));
response.setErrors(new ArrayList<>(errors));
xmlMapper.writeValue(outputStream, response);
Expand Down

0 comments on commit ea23ccc

Please sign in to comment.