results in a Map<String,String> (Note: this property has no value, only a group of parameters, so there is no element with the ":" key) Key Value RDATE 19970304,19970504,19970704,19970904 VALUE DATE
public final class ICalendarUtilities
extends java.lang.Object
Static utility methods used throughout iCalendar
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_VALUE_KEY |
Modifier and Type | Method and Description |
---|---|
static java.util.List<javafx.util.Pair<java.lang.String,java.lang.String>> |
contentToParameterListPair(java.lang.String propertyLine)
parse property content line into a parameter name/value map
content line must have the property name stripped off the front
|
static java.lang.CharSequence |
foldLine(java.lang.CharSequence line)
Folds lines at character 75 into multiple lines.
|
static java.lang.String |
getPropertyName(java.lang.String propertyLine)
Returns iCalendar property name from property content line.
|
static int |
getPropertyNameIndex(java.lang.String propertyLine)
Returns index where property name ends - after first ';' or ':'
|
static java.lang.String |
parameterMapToPropertyLine(java.util.Map<java.lang.String,java.lang.String> parameterMap)
Deprecated.
|
static VCalendar |
parseICalendarFile(java.nio.file.Path icsFilePath)
Parse iCalendar ics and add its properties to vCalendar parameter
|
static javafx.util.Pair<java.lang.String,java.lang.String> |
parsePropertyLine(java.lang.String line)
Deprecated.
|
static java.util.Map<java.lang.String,java.lang.String> |
propertyLineToParameterMapOld(java.lang.String propertyLine)
Deprecated.
|
static <T> java.util.stream.Stream<T> |
takeWhile(java.util.stream.Stream<T> stream,
java.util.function.Predicate<? super T> predicate) |
static java.lang.String |
unfoldLines(java.util.Iterator<java.lang.String> lineIterator,
javafx.beans.property.ObjectProperty<java.lang.String> storedLine)
Deprecated.
|
public static final java.lang.String PROPERTY_VALUE_KEY
public static java.util.List<javafx.util.Pair<java.lang.String,java.lang.String>> contentToParameterListPair(java.lang.String propertyLine)
parse property content line into a parameter name/value map content line must have the property name stripped off the front
For example, for the content line DTEND;TZID=Etc/GMT:20160306T103000Z the propertyLine must be ;TZID=Etc/GMT:20160306T103000Z
propertyLine
- - name-stripped property linepublic static java.lang.String getPropertyName(java.lang.String propertyLine)
Returns iCalendar property name from property content line. Returns empty string if propertyLine is null or empty
propertyLine
- - a iCalendar property line. The property name must be at the beginning of the linepublic static int getPropertyNameIndex(java.lang.String propertyLine)
Returns index where property name ends - after first ';' or ':'
@Deprecated public static java.lang.String unfoldLines(java.util.Iterator<java.lang.String> lineIterator, javafx.beans.property.ObjectProperty<java.lang.String> storedLine)
lineIterator
- content text iteratorstoredLine
- last line from iterator, empty string if nonepublic static java.lang.CharSequence foldLine(java.lang.CharSequence line)
Folds lines at character 75 into multiple lines. Follows rules in RFC 5545, 3.1 Content Lines, page 9. A space is added to the first character of the subsequent lines. doesn’t break lines at escape characters
line
- - content line@Deprecated public static java.util.Map<java.lang.String,java.lang.String> propertyLineToParameterMapOld(java.lang.String propertyLine)
Converts property line into a property-parameter/value map For example: RDATE;VALUE=DATE:19970304,19970504,19970704,19970904
results in a Map<String,String> (Note: this property has no value, only a group of parameters, so there is no element with the ":" key) Key Value RDATE 19970304,19970504,19970704,19970904 VALUE DATE
Another example ORGANIZER;CN=David Bal;SENT-BY="mailto:ddbal1@yahoo.com":mailto:ddbal1@yahoo.com results in a Map<String,String> Key Value CN David Bal Common Name parameter SENT-BY "mailto:ddbal1@yahoo.com" Sent By parameter (quotes will be stripped in the parameter enum's parsing method) ORGANIZER mailto:ddbal1@yahoo.com
STATUS:CONFIRMED Key Value STATUS CONFIRMED
RRULE:FREQ=DAILY;UNTIL=20160417T235959Z;INTERVAL=1 Key Value RRULE FREQ DAILY Frequency parameter UNTIL 20160417T235959Z Until parameter INTERVAL 1 Interval parameter
propertyLine
- @Deprecated public static java.lang.String parameterMapToPropertyLine(java.util.Map<java.lang.String,java.lang.String> parameterMap)
Converts property-parameter/value map into property line. This is the opposite operation
of #propertyLineToParameterMap(String)
parameterMap
- @Deprecated public static javafx.util.Pair<java.lang.String,java.lang.String> parsePropertyLine(java.lang.String line)
Splits a content line into its property name/value pair For example: RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO key = RRULE value = FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO
DTSTART;TZID=America/Los_Angeles:19970512T090000 key = DTSTART value = TZID=America/Los_Angeles:19970512T090000
line
- - single content line from calendarpublic static VCalendar parseICalendarFile(java.nio.file.Path icsFilePath)
Parse iCalendar ics and add its properties to vCalendar parameter
icsFilePath
- - URI of ics filevCalendar
- - vCalendar obj2ect with callbacks set for making components (e.g. makeVEventCallback)public static <T> java.util.stream.Stream<T> takeWhile(java.util.stream.Stream<T> stream, java.util.function.Predicate<? super T> predicate)