Buggy code:
public class CoreAdminHandler extends RequestHandlerBase { protected static Logger log = LoggerFactory . getLogger ( CoreAdminHandler . class ) ; protected final CoreContainer coreContainer ; public CoreAdminHandler ( ) { } public CoreAdminHandler ( final CoreContainer coreContainer ) { } @ Override public final void init ( NamedList args ) { } public CoreContainer getCoreContainer ( ) { } @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } protected boolean handleSplitAction ( SolrQueryRequest adminReq , SolrQueryResponse rsp ) throws IOException { } protected boolean handleMergeAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException { } protected boolean handleCustomAction ( SolrQueryRequest req , SolrQueryResponse rsp ) { } protected boolean handleCreateAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws SolrException { } protected boolean handleRenameAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws SolrException { } @ Deprecated protected boolean handleAliasAction ( SolrQueryRequest req , SolrQueryResponse rsp ) { } protected boolean handleUnloadAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws SolrException { SolrParams params = req . getParams ( ) ; String cname = params . get ( CORE ) ; SolrCore core = coreContainer . remove ( cname ) ; try { if ( core == null ) { throw new SolrException ( ErrorCode . BAD_REQUEST , ( ( "No<seq2seq4repair_space>such<seq2seq4repair_space>core<seq2seq4repair_space>exists<seq2seq4repair_space>'" + cname ) + "'" ) ) ; } else { if ( ( coreContainer . getZkController ( ) ) != null ) { CoreAdminHandler . log . info ( ( ( "Unregistering<seq2seq4repair_space>core<seq2seq4repair_space>" + ( core . getName ( ) ) ) + "<seq2seq4repair_space>from<seq2seq4repair_space>cloudstate." ) ) ; try { coreContainer . getZkController ( ) . unregister ( cname , core . getCoreDescriptor ( ) ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>unregister<seq2seq4repair_space>core<seq2seq4repair_space>" + cname ) + "<seq2seq4repair_space>from<seq2seq4repair_space>cloudstate:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ; } catch ( KeeperException e ) { throw new SolrException ( ErrorCode . SERVER_ERROR , ( ( ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>unregister<seq2seq4repair_space>core<seq2seq4repair_space>" + cname ) + "<seq2seq4repair_space>from<seq2seq4repair_space>cloudstate:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) , e ) ; } } if ( params . getBool ( DELETE_INDEX , false ) ) { try { core . getDirectoryFactory ( ) . remove ( core . getIndexDir ( ) ) ; } catch ( Exception e ) { SolrException . log ( CoreAdminHandler . log , ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>flag<seq2seq4repair_space>index<seq2seq4repair_space>dir<seq2seq4repair_space>for<seq2seq4repair_space>removal<seq2seq4repair_space>for<seq2seq4repair_space>core:" + ( core . getName ( ) ) ) + "<seq2seq4repair_space>dir:" ) + ( core . getIndexDir ( ) ) ) ) ; } } } if ( params . getBool ( DELETE_DATA_DIR , false ) ) { try { <START_BUG> core . getDirectoryFactory ( ) . remove ( core . getDataDir ( ) ) ; <END_BUG> } catch ( Exception e ) { SolrException . log ( CoreAdminHandler . log , ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>flag<seq2seq4repair_space>data<seq2seq4repair_space>dir<seq2seq4repair_space>for<seq2seq4repair_space>removal<seq2seq4repair_space>for<seq2seq4repair_space>core:" + ( core . getName ( ) ) ) + "<seq2seq4repair_space>dir:" ) + ( core . getDataDir ( ) ) ) ) ; } } if ( params . getBool ( DELETE_INSTANCE_DIR , false ) ) { core . addCloseHook ( new CloseHook ( ) { @ Override public void preClose ( SolrCore core ) { } @ Override public void postClose ( SolrCore core ) { CoreDescriptor cd = core . getCoreDescriptor ( ) ; if ( cd != null ) { File instanceDir = new File ( cd . getInstanceDir ( ) ) ; try { FileUtils . deleteDirectory ( instanceDir ) ; } catch ( IOException e ) { SolrException . log ( CoreAdminHandler . log , ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>delete<seq2seq4repair_space>instance<seq2seq4repair_space>dir<seq2seq4repair_space>for<seq2seq4repair_space>core:" + ( core . getName ( ) ) ) + "<seq2seq4repair_space>dir:" ) + ( instanceDir . getAbsolutePath ( ) ) ) ) ; } } } } ) ; } } finally { if ( core != null ) { if ( ( coreContainer . getZkController ( ) ) != null ) { core . getSolrCoreState ( ) . cancelRecovery ( ) ; } core . close ( ) ; } } return coreContainer . isPersistent ( ) ; } protected boolean handleStatusAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws SolrException { } protected boolean handlePersistAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws SolrException { } protected boolean handleReloadAction ( SolrQueryRequest req , SolrQueryResponse rsp ) { } protected boolean handleSwapAction ( SolrQueryRequest req , SolrQueryResponse rsp ) { } protected void handleRequestRecoveryAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException { } protected void handleRequestSyncAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException { } protected void handleWaitForStateAction ( SolrQueryRequest req , SolrQueryResponse rsp ) throws IOException , InterruptedException , KeeperException { } protected NamedList < Object > getCoreStatus ( CoreContainer cores , String cname , boolean isIndexInfoNeeded ) throws IOException { } private long getIndexSize ( SolrCore core ) { } protected static String normalizePath ( String path ) { } public static ModifiableSolrParams params ( String ... params ) { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } }

Fix:
core . getDirectoryFactory ( ) . remove ( core . getDataDir ( ) , true ) ;