Bläddra i källkod

Add Javadocs for RemovePluginCommand#execute

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

Relates #23644
Alex Lattas 8 år sedan
förälder
incheckning
f9d6924f7d
1 ändrade filer med 13 tillägg och 2 borttagningar
  1. 13 2
      core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java

+ 13 - 2
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");
         }