class PostmanService {

    void saveExecutionStreamToFile(Execution execution) throws IOException {
        if (execution.getResponse() == null ||
                execution.getResponse().getStream() == null ||
                execution.getResponse().getStream().getData() == null) {
            return;
        }

        final Stream stream = execution.getResponse().getStream();

        File file = File.createTempFile("ara_execution_response_stream_", ".bin");
        file.deleteOnExit();
        FileUtils.writeByteArrayToFile(file, stream.getData());
        stream.setTempFile(file);
        stream.setData(null);
    }

}