use of org.eclipse.scout.rt.shared.services.common.calendar.HolidayCalendarItemParser in project scout.rt by eclipse.
the class HolidayCalendarService method getItems.
@Override
public Set<? extends ICalendarItem> getItems(RemoteFile spec, Date minDate, Date maxDate) {
// load new items
HolidayCalendarItemParser p = null;
String key = spec.getPath();
synchronized (m_holidayXmlCache) {
p = m_holidayXmlCache.get(key);
if (p == null) {
try {
RemoteFile f = BEANS.get(IRemoteFileService.class).getRemoteFile(spec);
if (f != null) {
p = new HolidayCalendarItemParser(f.getDecompressedInputStream(), spec.getPath());
m_holidayXmlCache.put(key, p);
}
} catch (Exception e) {
LOG.warn("parsing remote file: {}", spec, e);
}
}
}
final Set<? extends ICalendarItem> result;
if (p != null) {
result = p.getItems(NlsLocale.get(), minDate, maxDate);
} else {
result = CollectionUtility.hashSet();
}
return result;
}
Aggregations