Professional Documents
Culture Documents
Public Holiday Scapper
Public Holiday Scapper
* Adds public holidays by country and year from a website with all public
holidays.
*
* @param countryHolidaysDto The DTO with country and year.
* @return TRUE after all the entities have been added.
*/
Boolean addPublicHolidays(CountryHolidaysDto countryHolidaysDto) throws
IOException {
types.remove(0);
if (types.get(i).text().equals("National Holiday")) {
HolidayPublic holidayPublic = new HolidayPublic();
holidayPublic.setName(holidayNames.get(i).text());
holidayPublic.setDate(LocalDate.parse(dates.get(i).attr("datetime"),
dateTimeFormatter));
holidayPublicRepository.save(holidayPublic);
}
}
return true;
}