settings = new AJSettings(nick, port, xmlPort, maxUpload, maxDownload, speedPerSlot, incomingDir, tempDir, shareEntries, maxConnections, autoConnect, maxNewConnectionsPerTurn); }
  public void update() {    reload("");    NodeList nodes = document.getElementsByTagName("nick");    String nick = nodes.item(0).getFirstChild().getNodeValue();    nodes = document.getElementsByTagName("port");    long port = Long.parseLong(nodes.item(0).getFirstChild().getNodeValue());    nodes = document.getElementsByTagName("xmlport");    long xmlPort = Long.parseLong(nodes.item(0).getFirstChild().getNodeValue());    nodes = document.getElementsByTagName("maxupload");    long maxUpload = Long.parseLong(nodes.item(0).getFirstChild().getNodeValue());    nodes = document.getElementsByTagName("maxdownload");    long maxDownload = Long.parseLong(nodes.item(0).getFirstChild().                                      getNodeValue());    nodes = document.getElementsByTagName("maxconnections");    long maxConnections = Long.parseLong(nodes.item(0).getFirstChild().                                      getNodeValue());    nodes = document.getElementsByTagName("autoconnect");    boolean autoConnect = new Boolean(nodes.item(0).getFirstChild().                                      getNodeValue()).booleanValue();    nodes = document.getElementsByTagName("speedperslot");    int speedPerSlot = Integer.parseInt(nodes.item(0).getFirstChild().                                        getNodeValue());    nodes = document.getElementsByTagName("maxnewconnectionsperturn");    long maxNewConnectionsPerTurn = Long.parseLong(nodes.item(0).getFirstChild().                                        getNodeValue());    nodes = document.getElementsByTagName("incomingdirectory");    String incomingDir = nodes.item(0).getFirstChild().getNodeValue();    nodes = document.getElementsByTagName("temporarydirectory");    String tempDir = nodes.item(0).getFirstChild().getNodeValue();    HashSet shareEntries = new HashSet();    nodes = document.getElementsByTagName("directory");    Element e = null;    String dir = null;    String shareMode = null;    ShareEntry entry = null;    int nodesSize = nodes.getLength();    for (int i = 0; i < nodesSize; i++) {      e = (Element) nodes.item(i);      dir = e.getAttribute("name");      shareMode = e.getAttribute("sharemode");      entry = new ShareEntry(dir, shareMode);      shareEntries.add(entry);    }    settings = new AJSettings(nick, port, xmlPort, maxUpload,                              maxDownload, speedPerSlot, incomingDir, tempDir,                              shareEntries, maxConnections, autoConnect,                              maxNewConnectionsPerTurn);  }