James Raitsev
James Raitsev

Reputation: 96371

validating json file using java

I am using classes which came from json.org. Using them, can someone suggest a sniplet of the code which would let one parse the input stream to see whether it represents a valid json file.

Upvotes: 0

Views: 705

Answers (1)

Manoj
Manoj

Reputation: 5602

Just use the JSONObject constructor and it throws JSONException if the source string is not proper JSON formatted String.

Upvotes: 3

Related Questions