mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[icalendar] Use cache folder to store calendar file (#9911)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
4fba096057
commit
5fe2f9c83a
@ -85,8 +85,14 @@ public class ICalendarHandler extends BaseBridgeHandler implements CalendarUpdat
|
|||||||
TimeZoneProvider tzProvider) {
|
TimeZoneProvider tzProvider) {
|
||||||
super(bridge);
|
super(bridge);
|
||||||
this.httpClient = httpClient;
|
this.httpClient = httpClient;
|
||||||
calendarFile = new File(OpenHAB.getUserDataFolder() + File.separator
|
final File cacheFolder = new File(new File(OpenHAB.getUserDataFolder(), "cache"),
|
||||||
+ getThing().getUID().getAsString().replaceAll("[<>:\"/\\\\|?*]", "_") + ".ical");
|
"org.openhab.binding.icalendar");
|
||||||
|
if (!cacheFolder.exists()) {
|
||||||
|
logger.debug("Creating cache folder '{}'", cacheFolder.getAbsolutePath());
|
||||||
|
cacheFolder.mkdirs();
|
||||||
|
}
|
||||||
|
calendarFile = new File(cacheFolder,
|
||||||
|
getThing().getUID().getAsString().replaceAll("[<>:\"/\\\\|?*]", "_") + ".ical");
|
||||||
eventPublisherCallback = eventPublisher;
|
eventPublisherCallback = eventPublisher;
|
||||||
updateStatesLastCalledTime = Instant.now();
|
updateStatesLastCalledTime = Instant.now();
|
||||||
this.tzProvider = tzProvider;
|
this.tzProvider = tzProvider;
|
||||||
|
Loading…
Reference in New Issue
Block a user