protected String processCommand(final String command, final Map<String, String> environment,
      final MultipartFile[] multipartFiles) throws IOException {
    List<String> filePaths = null;
    Path tempDir = null;
    if (multipartFiles != null) {
      tempDir = FileUploader.createSecuredTempDirectory("uploaded-");
      // staging the files to local
      filePaths = new ArrayList<>();
      for (MultipartFile multipartFile : multipartFiles) {
        File dest = new File(tempDir.toFile(), multipartFile.getOriginalFilename());
        multipartFile.transferTo(dest);
        filePaths.add(dest.getAbsolutePath());
      }
    }

    MemberMXBean manager = getManagingMemberMXBean();
    try {
      return manager.processCommand(command, environment, filePaths);
    } finally {
      if (tempDir != null) {
        FileUtils.deleteDirectory(tempDir.toFile());
      }
    }
  }
Executes the specified command as entered by the user using the GemFire Shell (Gfsh). Note,
Gfsh performs validation of the command during parsing before sending the command to the
Manager for processing.

@param command a String value containing a valid command String as would be entered by the user
       in Gfsh.
@param environment a Map containing any environment configuration settings to be used by the
       Manager during command execution. For example, when executing commands originating from
       Gfsh, the key/value pair (APP_NAME=gfsh) is a specified mapping in the "environment.
       Note, it is common for the REST API to act as a bridge, or an adapter between Gfsh and
       the Manager, and thus need to specify this key/value pair mapping.
@param multipartFiles uploaded files
@return a result of the command execution as a String, typically marshalled in JSON to be
        serialized back to Gfsh.
geode-web/src/main/java/org/apache/geode/management/internal/web/controllers/AbstractCommandsController.java