parseSettings

Parse JSON string to Settings object.

This method efficiently parses Google Takeout Settings.json data using cached adapters for optimal performance on repeated calls.

Return

Parsed Settings object

Parameters

json

The JSON string containing Settings data

Throws

JsonDataException

if the JSON is malformed or missing required fields

if json parameter is null

// Sample usage of parser to parse settings JSON.
val parser = Parser()
val json: String = File("your-file.json").bufferedReader().readText()
val settings: Settings = parser.parseSettings(json)

fun parseSettings(bufferedSource: BufferedSource): Settings

Parse JSON buffered source to Settings object.

This method efficiently parses Google Takeout Settings.json data using cached adapters and is recommended for large files as it provides better I/O performance.

Return

Parsed Settings object

Parameters

bufferedSource

The BufferedSource containing Settings JSON data

Throws

JsonDataException

if the JSON is malformed or missing required fields

if bufferedSource parameter is null

// Sample usage of parser to parse settings JSON.
val parser = Parser()
val bufferedSource: BufferedSource = File("your-file.json").source().buffer()
val settings: Settings = parser.parseSettings(bufferedSource)