private boolean configUpdated ( ) { try { URL url = ctx . getResource ( resourcesDir + configResource ) ; URLConnection con ; if ( url == null ) return false ; con = url . openConnection ( ) ; long lastModified = con . getLastModified ( ) ; long XHP_LAST_MODIFIEDModified = 0 ; if ( ctx . getAttribute ( XHP_LAST_MODIFIED ) != null ) { XHP_LAST_MODIFIEDModified = ( ( Long ) ctx . getAttribute ( XHP_LAST_MODIFIED ) ) . longValue ( ) ; } else { ctx . setAttribute ( XHP_LAST_MODIFIED , new Long ( lastModified ) ) ; return false ; } if ( XHP_LAST_MODIFIEDModified < lastModified ) { ctx . setAttribute ( XHP_LAST_MODIFIED , new Long ( lastModified ) ) ; return true ; } } catch ( Exception ex ) { getLogger ( ) . severe ( "XmlHttpProxyServlet error checking configuration: " + ex ) ; } return false ; }
Check to see if the configuration file has been updated so that it may be reloaded .