code: public String putService(String username,
        String serviceClass,
        String serviceName,
        ServiceRecord record,
        boolean deleteTreeFirst) throws IOException {
      String path = RegistryUtils.servicePath(
          username, serviceClass, serviceName);
      if (deleteTreeFirst) {
        registryOperations.delete(path, true);
      }
      registryOperations.mknode(RegistryPathUtils.parentOf(path), true);
      registryOperations.bind(path, record, BindFlags.OVERWRITE);
      return path;
    }
docs: Add a service under a path, optionally purging any history
  @param username user
  @param serviceClass service class to use under ~user
  @param serviceName name of the service
  @param record service record
  @param deleteTreeFirst perform recursive delete of the path first.
  @return the path the service was created at
  @throws IOException