private void doDelete ( ) throws PageException , SearchException { required ( "index" , action , "collection" , collection ) ; if ( type != SearchIndex . TYPE_CUSTOM ) required ( "index" , action , "key" , key ) ; // no type defined if ( type == - 1 ) { if ( query != null ) { type = SearchIndex . TYPE_CUSTOM ; } else { Resource file = null ; try { file = ResourceUtil . toResourceExisting ( pageContext , key ) ; pageContext . getConfig ( ) . getSecurityManager ( ) . checkFileLocation ( file ) ; } catch ( ExpressionException e ) { } if ( file != null && file . exists ( ) && file . isFile ( ) ) type = SearchIndex . TYPE_FILE ; else if ( file != null && file . exists ( ) && file . isDirectory ( ) ) type = SearchIndex . TYPE_PATH ; else { try { new URL ( key ) ; type = SearchIndex . TYPE_URL ; } catch ( MalformedURLException e ) { } } } } collection . deleteIndex ( pageContext , key , type , query ) ; }
delete a collection