From f9d6924f7d5fb46fb196dc2db5d246781fa0a8ce Mon Sep 17 00:00:00 2001 From: Alex Lattas Date: Mon, 20 Mar 2017 04:11:50 +0200 Subject: [PATCH] Add Javadocs for RemovePluginCommand#execute This commit adds Javadocs for RemovePluginCommand#execute, the actual implementation of the remove plugin command. Relates #23644 --- .../plugins/RemovePluginCommand.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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"); }