*
* @param url URL string for scan.
* @return PGN game.
- * @throws ChessHogScannerException Incorrect URL or unknown chess portal.
+ * @throws ScannerException Incorrect URL or unknown chess portal.
*/
- public static PGNGame scan(String url) throws ChessHogScannerException {
+ public static PGNGame scan(String url) throws ScannerException {
String hostName;
try {
hostName = new URL(url).getHost();
} catch (MalformedURLException cause) {
- throw new ChessHogScannerException(
+ throw new ScannerException(
String.format("Incorrect URL: %s", url), cause
);
}
ScannerType type = ScannerType.byHost(hostName);
if (type == null) {
- throw new ChessHogScannerException(
+ throw new ScannerException(
String.format("Host %s is not among the known for the scanner", hostName)
);
}
initiableScanner.init();
}
initScanners.add(type);
- } catch (ChessHogScannerException e) {
+ } catch (ScannerException e) {
throw new RuntimeException(e);
}
}
}
private ChessHogScanner() {
- if (!ChessHogScannerProperties.is("scanner.lazy.init")) {
+ if (!ScannerProperties.is("scanner.lazy.init")) {
init();
}
}