public void uninstall ( String pluginKey , File uninstallDir ) { Set < String > uninstallKeys = new HashSet <> ( ) ; uninstallKeys . add ( pluginKey ) ; appendDependentPluginKeys ( pluginKey , uninstallKeys ) ; for ( String uninstallKey : uninstallKeys ) { PluginInfo info = getPluginInfo ( uninstallKey ) ; try { if ( ! getPluginFile ( info ) . exists ( ) ) { LOG . info ( "Plugin already uninstalled: {} [{}]" , info . getName ( ) , info . getKey ( ) ) ; continue ; } LOG . info ( "Uninstalling plugin {} [{}]" , info . getName ( ) , info . getKey ( ) ) ; File masterFile = getPluginFile ( info ) ; moveFileToDirectory ( masterFile , uninstallDir , true ) ; } catch ( IOException e ) { throw new IllegalStateException ( format ( "Fail to uninstall plugin %s [%s]" , info . getName ( ) , info . getKey ( ) ) , e ) ; } } }
Uninstall a plugin and its dependents