* @throws JSONException if the conversion from XML to JSON can't be made for I/O or
* format reasons.
*/
public JSON readFromFile(File file) {
if (file == null) {
throw new JSONException("File is null");
}
if (!file.canRead()) {
throw new JSONException("Can't read input file");
}
if (file.isDirectory()) {
throw new JSONException("File is a directory");
}
try {
return readFromStream(new FileInputStream(file));
} catch (IOException ioe) {
throw new JSONException(ioe);
}
}