private static void copyResourceToFile(final URL resource, final File targetFile) {
    try (InputStream inputStream = resource.openStream();
        OutputStream outputStream = new FileOutputStream(targetFile)) {
      IOUtils.copy(inputStream, outputStream);
    } 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