/** Generates a valid Atom id. */
  public String generateAtomId(String input) {
    if (input == null) {
      return ID_DUMMY;
    }

    return ID_PREFIX + Base64.encodeBytes(IOUtils.toUTF8Bytes(input));
  }
 public void writeServiceLink(String href, String repositoryId) throws XMLStreamException {
   writeLink(
       Constants.REL_SERVICE,
       href + "?repositoryId=" + IOUtils.encodeURL(repositoryId),
       Constants.MEDIATYPE_SERVICE,
       null);
 }