@Override public void populateCacheElement(CacheElement cacheElement, String password) { String method = "populateCacheElement()"; if (log.isDebugEnabled()) { log.debug(enter(method)); } Boolean authenticated = null; Map namedAttributes = null; String errorMessage = null; authenticated = Boolean.FALSE; try { InputStream is; try { is = new FileInputStream(getFilepath()); } catch (Throwable th) { showThrowable(th, log, "error reading tomcat users file " + getFilepath()); throw th; } if (log.isDebugEnabled()) { log.debug("read tomcat-users.xml"); } ParserXmlUserfile parser = new ParserXmlUserfile(is); if (log.isDebugEnabled()) { log.debug("got parser"); } try { parser.parse(cacheElement.getUserid(), password); if (log.isDebugEnabled()) { log.debug("back from parsing"); } } catch (FinishedParsingException f) { if (log.isDebugEnabled()) { log.debug(format(method, "got finished parsing exception")); } } catch (Throwable th) { String msg = "error parsing tomcat users file"; showThrowable(th, log, msg); throw new IOException(msg); } authenticated = parser.getAuthenticated(); namedAttributes = parser.getNamedAttributes(); } catch (Throwable t) { authenticated = null; namedAttributes = null; } if (log.isDebugEnabled()) { log.debug(format(method, null, "authenticated")); log.debug(authenticated); log.debug(format(method, null, "namedAttributes")); log.debug(namedAttributes); log.debug(format(method, null, "errorMessage", errorMessage)); } cacheElement.populate(authenticated, null, namedAttributes, errorMessage); if (log.isDebugEnabled()) { log.debug(exit(method)); } }