Skip to content

Instantly share code, notes, and snippets.

@aartajew
Last active April 20, 2023 10:01
Show Gist options
  • Save aartajew/4c30e51b7b1198724314e6bf8f91540f to your computer and use it in GitHub Desktop.
Save aartajew/4c30e51b7b1198724314e6bf8f91540f to your computer and use it in GitHub Desktop.
Gatling > Save response body to a file
package util
import java.io._
import java.nio.file._
object SaveResponseBodyToFile {
def apply(body: InputStream, path: String) = {
val file = new File(path)
new File(file.getParent).mkdirs()
Files.copy(body, file.toPath, StandardCopyOption.REPLACE_EXISTING)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment