Using Java is there an easy way to check whether a given file conforms to json format?
Using gson, the best i can do is:
private final JsonParser parser = new JsonParser();
jsonElement = parser.parse(new FileReader(fileName));
if (jsonElement.isJsonObject()) {
return true;
} else {
return false;
}
Any cleaner ideas?