engineRequest.setBucketName(bucket);
engineRequest.setKey(key);
engineRequest.setMetaEntries(meta);
engineRequest.setCannedAccess(cannedAccess);
S3PutObjectInlineResponse engineResponse = ServiceProvider.getInstance().getS3Engine().concatentateMultipartUploads( response, engineRequest, parts, os );
int result = engineResponse.getResultCode();
// -> free all multipart state since we now have one concatentated object
if (200 == result) ServiceProvider.getInstance().getS3Engine().freeUploadParts( bucket, uploadId, false );
// -> if all successful then clean up all left over parts
if ( 200 == result )
{
StringBuffer xml = new StringBuffer();
xml.append( "<?xml version=\"1.0\" encoding=\"utf-8\"?>" );
xml.append( "<CompleteMultipartUploadResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">" );
xml.append( "<Location>" ).append( "http://" + bucket + ".s3.amazonaws.com/" + key ).append( "</Location>" );
xml.append( "<Bucket>" ).append( bucket ).append( "</Bucket>" );
xml.append( "<Key>" ).append( key ).append( "</Key>" );
xml.append( "<ETag>\"" ).append( engineResponse.getETag()).append( "\"</<ETag>" );
xml.append( "</CompleteMultipartUploadResult>" );
os.write( xml.toString().getBytes());
os.close();
}
else returnErrorXML( result, null, os );