class CreateBucketInterceptor extends AbstractCallInterceptor
{
@Override
public void beforeCall(InvocationContext invocationContext) throws Throwable
{
BucketLocation location = (BucketLocation) invocationContext.getParam("location");
if (location.equals(BucketLocation.EU))
{
invocationContext.addRequestPayload("<CreateBucketConfiguration><LocationConstraint>EU</LocationConstraint></CreateBucketConfiguration>");
invocationContext.addRequestHeaderParam("Content-Type", "text/plain; charset=UTF-8");
}
}
}