-
-
Save kasramp/2f6b7965c096fa7c98987b6a7e9f9848 to your computer and use it in GitHub Desktop.
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
import com.fasterxml.jackson.module.kotlin.readValue | |
val file = Files.createTempFile("students", ".json").toFile() | |
var pageNumber = 0 | |
val studentsFileContent = objectMapper.readValue<List<Student>>(file).toMutableList() | |
do { | |
val result = getStudentsDetailsByPage(pageNumber) | |
studentsFileContent.addAll(result) | |
pageNumber += 1 | |
} while (result.hasNext()) | |
objectMapper.writeValue(file, studentsFileContent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment