private void copyTomcatGeodeReqFiles(Path moduleJarDir, Path extraJarsPath)
      throws IOException {
    List<File> requiredFiles = new ArrayList<>();

    // The library path for the current tomcat installation
    Path tomcatLibPath = getHome().resolve("lib");

    // List of required jars and form version regexps from them
    String versionRegex = "-?[0-9]*.*\\.jar";
    List<Pattern> patterns = new ArrayList<>(tomcatRequiredJars.length);
    for (String jar : tomcatRequiredJars) {
      patterns.add(Pattern.compile(jar + versionRegex));
    }

    // Don't need to copy any jars already in the tomcat install
    File tomcatLib = tomcatLibPath.toFile();

    // Find all jars in the tomcatModulePath and add them as required jars
    try {
      for (File file : moduleJarDir.toFile().listFiles()) {
        if (file.isFile() && file.getName().endsWith(".jar")) {
          requiredFiles.add(file);
        }
      }
    } catch (NullPointerException e) {
      throw new IOException(
          "No files found in tomcat module directory " + getModulePath() + "/lib/");
    }

    // Find all the required jars in the extraJarsPath
    try {
      for (File file : extraJarsPath.toFile().listFiles()) {
        for (Pattern pattern : patterns) {
          if (pattern.matcher(file.getName()).find()) {
            requiredFiles.add(file);
            break;
          }
        }
      }
    } catch (NullPointerException e) {
      throw new IOException("No files found in extra jars directory " + extraJarsPath);
    }

    // Copy the required jars to the given tomcat lib folder
    for (File file : requiredFiles) {
      Files.copy(file.toPath(), tomcatLib.toPath().resolve(file.toPath().getFileName()),
          StandardCopyOption.REPLACE_EXISTING);
      logger.debug("Copied required jar from " + file.toPath() + " to "
          + tomcatLibPath.resolve(file.toPath().getFileName()));
    }

    logger.info("Copied required jars into the Tomcat installation");
  }
Copies jars specified by {@link #tomcatRequiredJars} from the {@link #getModulePath()} and the
specified other directory passed to the function

@throws IOException if the {@link #getModulePath()}, installation lib directory, or extra
        directory passed in contain no files.
geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/TomcatInstall.java