public static UserList getUserList() throws SearchLibException {
   usersLock.r.lock();
   try {
     if (userList == null) {
       File userFile = new File(StartStopListener.OPENSEARCHSERVER_DATA_FILE, "users.xml");
       if (userFile.exists()) {
         XPathParser xpp = new XPathParser(userFile);
         userList = UserList.fromXml(xpp, xpp.getNode("/" + UserList.usersElement));
       } else userList = new UserList();
     }
     return userList;
   } catch (ParserConfigurationException e) {
     throw new SearchLibException(e);
   } catch (SAXException e) {
     throw new SearchLibException(e);
   } catch (IOException e) {
     throw new SearchLibException(e);
   } catch (XPathExpressionException e) {
     throw new SearchLibException(e);
   } finally {
     usersLock.r.unlock();
   }
 }
Beispiel #2
0
 public Boolean evalBoolean(String expression) {
   return xpathParser.evalBoolean(node, expression);
 }
Beispiel #3
0
 public String evalString(String expression) {
   return xpathParser.evalString(node, expression);
 }
Beispiel #4
0
 public XNode evalNode(String expression) {
   return xpathParser.evalNode(node, expression);
 }
Beispiel #5
0
 public List<XNode> evalNodes(String expression) {
   return xpathParser.evalNodes(node, expression);
 }
Beispiel #6
0
 public Double evalDouble(String expression) {
   return xpathParser.evalDouble(node, expression);
 }