public void deleteDir ( String key , boolean recursive ) throws EtcdClientException { Preconditions . checkNotNull ( key ) ; Map < String , String > params = new HashMap < String , String > ( ) ; if ( recursive ) { params . put ( "recursive" , String . valueOf ( true ) ) ; } else { params . put ( "dir" , String . valueOf ( true ) ) ; } URI uri = buildUriWithKeyAndParams ( key , params ) ; HttpDelete httpDelete = new HttpDelete ( uri ) ; syncExecute ( httpDelete , new int [ ] { 200 , 403 } ) ; }
Deleting a directory