Why do you need to initialise an empty content object and contentType here? Those are fetched later else an exception is thrown.