All pastes #197900 Raw Edit

Someone

public text v1 · immutable
·published 2006-10-11 16:26 UTC
rendered paste body
  public void setIdentity(String id) {
    String id_new=null;
    if (id.endsWith("\0")) {
      id_new = new String (id.substring(0,id.length()-1) +"\\0");
    } else {
      id_new=id;
    }
    
    try {
      Node n = this.documentRoot.getElementsByTagName("IDENTIDAD_PRINCIPAL").
          item(0);
      try {
        n.getFirstChild().setNodeValue(id_new);
      }
      catch (Exception e) {
        // no hay datos, hay que crear el nodo de datos
        n.appendChild(documentRoot.createTextNode(id));
      }

      AlmacenIdentidades.getInstance().reloadConfiguration();
    }