private boolean isDebug ( CmsObject cms , CmsSolrQuery query ) { String [ ] debugSecretValues = query . remove ( REQUEST_PARAM_DEBUG_SECRET ) ; String debugSecret = ( debugSecretValues == null ) || ( debugSecretValues . length < 1 ) ? null : debugSecretValues [ 0 ] ; if ( ( null != debugSecret ) && ! debugSecret . trim ( ) . isEmpty ( ) && ( null != m_handlerDebugSecretFile ) ) { try { CmsFile secretFile = cms . readFile ( m_handlerDebugSecretFile ) ; String secret = new String ( secretFile . getContents ( ) , CmsFileUtil . getEncoding ( cms , secretFile ) ) ; return secret . trim ( ) . equals ( debugSecret . trim ( ) ) ; } catch ( Exception e ) { LOG . info ( "Failed to read secret file for index \"" + getName ( ) + "\" at path \"" + m_handlerDebugSecretFile + "\"." ) ; } } return false ; }
Checks if the query should be executed using the debug mode where the security restrictions do not apply .