Add Javadocs for RemovePluginCommand#execute

This commit adds Javadocs for RemovePluginCommand#execute, the actual
implementation of the remove plugin command.

Relates #23644
This commit is contained in:
Alex Lattas 2017-03-20 04:11:50 +02:00 committed by Jason Tedor
parent b23adb6d15
commit f9d6924f7d
1 changed files with 13 additions and 2 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.plugins;
import java.io.IOException;
import java.nio.file.AtomicMoveNotSupportedException;
import java.nio.file.Files;
import java.nio.file.Path;
@ -56,8 +57,18 @@ class RemovePluginCommand extends EnvironmentAwareCommand {
execute(terminal, arg, env);
}
// pkg private for testing
void execute(Terminal terminal, String pluginName, Environment env) throws Exception {
/**
* Remove the plugin specified by {@code pluginName}.
*
* @param terminal the terminal to use for input/output
* @param pluginName the name of the plugin to remove
* @param env the environment for the local node
* @throws IOException if any I/O exception occurs while performing a file operation
* @throws UserException if plugin name is null
* @throws UserException if plugin directory does not exist
* @throws UserException if the plugin bin directory is not a directory
*/
void execute(Terminal terminal, String pluginName, Environment env) throws IOException, UserException {
if (pluginName == null) {
throw new UserException(ExitCodes.USAGE, "plugin name is required");
}