public static void copyDirectoryResource(final URL resource, final File targetFolder) {
    try {
      File source = new File(resource.getPath());
      assertThat(source)
          .as("Resource path '" + resource.getPath() + "'")
          .exists();
      FileUtils.copyDirectory(source, targetFolder);
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
  }
Copies a directory, pointed to by a {@code resource}, to a {@code targetFolder}

@param resource a file-based resource referencing a directory
@param targetFolder the directory to which to copy the resource and all files within that
       resource.

@throws AssertionError if the resulting file does not exist

@throws UncheckedIOException if an I/O exception occurs or the file exists but is a directory
        rather than a regular file, does not exist but cannot be created, or cannot be opened
        for any other reason
geode-junit/src/main/java/org/apache/geode/test/util/ResourceUtils.java