2

Below is my ics file and I want to add REFRESH-INTERVAL;VALUE=DURATION:PT12H parameter in the file using ical4j library in java. Can anyone suggest how to perform that action.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//My Company//NONSGML Event Calendar//EN
URL:http://my.calendar/url
NAME:My Calendar Name
X-WR-CALNAME:My Calendar Name
DESCRIPTION:A description of my calendar
X-WR-CALDESC:A description of my calendar
TIMEZONE-ID:Europe/London
X-WR-TIMEZONE:Europe/London
X-PUBLISHED-TTL:PT12H
COLOR:34:50:105
CALSCALE:GREGORIAN
METHOD:PUBLISH

1 Answers1

0

I did it this way

ParameterList valueDuration = new ParameterList();
valueDuration.add(new Value("DURATION"));
calendar.getProperties().add(new RefreshInterval(valueDuration, java.time.Duration.ofMinutes(30) ));

which results in output of

REFRESH-INTERVAL;VALUE=DURATION:PT30M
cljk
  • 936
  • 1
  • 7
  • 20