Owner owner = findOwner(ownerKey);
activationKey.setOwner(owner);
if (StringUtils.isBlank(activationKey.getName())) {
throw new BadRequestException(
i18n.tr("Must provide a name for activation key."));
}
String testName = activationKey.getName().replace("-", "0")
.replace("_", "0");
if (!testName.matches("[a-zA-Z0-9]*")) {
throw new BadRequestException(
i18n.tr("The activation key name ''{0}'' must be alphanumeric or " +
"include the characters '-' or '_'", activationKey.getName()));
}
if (activationKeyCurator.lookupForOwner(activationKey.getName(), owner) != null) {
throw new BadRequestException(
i18n.tr("The activation key name ''{0}'' is already in use for owner {1}",
activationKey.getName(), ownerKey));
}
if (activationKey.getContentOverrides() != null) {