Last active
April 20, 2023 10:01
-
-
Save aartajew/4c30e51b7b1198724314e6bf8f91540f to your computer and use it in GitHub Desktop.
Gatling > Save response body to a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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