if (parts.length == 1) {
return new AttachmentId("", parts[0]);
}
// Not a valid id, throw an exception.
throw new InvalidIdException(attachmentIdString,
"Unable to deserialise the attachment id: " + attachmentIdString +
". The attachment id needs to look like <domain>/<id> or <id>");
}