private Path findAndExtractModule(Path defaultModulesDir, Path geodeModuleLocation,
      String moduleName)
      throws IOException {
    logger.info("Trying to access build dir {}", geodeModuleLocation);

    // Search directory for tomcat module folder/zip
    final Path moduleSource = Files.list(geodeModuleLocation)
        .filter(p -> p.toString().toLowerCase().contains(moduleName))
        .findFirst()
        .map(Path::toAbsolutePath)
        .orElseThrow(() -> new AssertionError("Could not find module " + moduleName));

    if (isDirectory(moduleSource)) {
      return moduleSource;
    }

    String moduleFileNameFull = moduleSource.getFileName().toString();

    // Get the name of the new module folder within the extraction directory
    final Path moduleDestinationDir = defaultModulesDir.resolve(getBaseName(moduleFileNameFull));

    // Remove any previous module folders extracted here
    if (isDirectory(moduleDestinationDir)) {
      logger.info("Deleting previous modules directory {}", moduleDestinationDir);
      deleteDirectory(moduleDestinationDir.toFile());
    }

    // Unzip if it is a zip file
    assertThat(moduleSource).isRegularFile();

    if (!getExtension(moduleFileNameFull).equals("zip")) {
      throw new IOException("Bad module archive " + moduleSource);
    }

    // Extract folder to location if not already there
    unzip(moduleSource.toString(), moduleDestinationDir.toString());

    return moduleDestinationDir;
  }
Finds and extracts the geode module associated with the specified module.

@param moduleName The module name (i.e. tomcat, appserver, etc.) of the module that should be
       extract. Used as a search parameter to find the module archive.
@return The path to the non-archive (extracted) version of the module files
geode-assembly/geode-assembly-test/src/main/java/org/apache/geode/session/tests/ContainerInstall.java