res.add(tmp);
}
} catch (IOException | InterruptedException | ExecutionException e) {
- e.printStackTrace();
+ logger.error("Exception was thrown during web scraping", e);
}
logger.info("scraping compeleted in " + (System.currentTimeMillis() - time)+ "ms");
return res;
try {
property = new ObjectMapper().readValue(new File(DBPATH), SongJSONProperty.class);
} catch (IOException e) {
- e.printStackTrace();
+ logger.error("IOException was thrown during reading From JSON Database file.", e);
}
ArrayList<Song> res = new ArrayList<Song>();
if(property != null) {
Files.createDirectory(Paths.get("generated"));
writer.writeValue(Paths.get(DBPATH).toFile(), property);
} catch (IOException e) {
+ logger.error("IOException was thrown during writing to JSON database file.", e);
res = false;
}
return res;