}
raf = new RandomAccessFile(file, "r");
// will throw an exception if not a valid file
new GridShiftFile().loadGridShiftFile(raf);
} else {
InputStream in = new BufferedInputStream(url.openConnection().getInputStream());
// will throw an exception if not a valid file
new GridShiftFile().loadGridShiftFile(in, false);
}
return true; // No exception thrown => valid file.
} catch (IllegalArgumentException e) {
// This usually means resource is not a valid NTv2 file.