diff --git a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java index 5219e50285c..ea8bb52aad9 100644 --- a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java +++ b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java @@ -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"); }