java.lang.Object
net.fortuna.ical4j.util.Calendars
$Id$
Created on 10/11/2006
Utility method for working with
Calendars.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetContentType(Calendar calendar, Charset charset) Deprecated.static UidDeprecated.static CalendarLoads a calendar from the specified file.static CalendarLoads a calendar from the specified URL.static CalendarMerge all properties and components from multiple calendars into one instance.static Calendar[]Deprecated.static Calendarwrap(CalendarComponent... component) Wraps a component in a calendar.static Calendarwrap(PropertyList properties, CalendarComponent... component)
-
Method Details
-
load
Loads a calendar from the specified file.- Parameters:
filename- the name of the file from which to load calendar data- Returns:
- returns a new calendar instance initialised from the specified file
- Throws:
IOException- occurs when there is an error reading the specified fileParserException- occurs when the data in the specified file is invalid
-
load
Loads a calendar from the specified URL.- Parameters:
url- the URL from which to load calendar data- Returns:
- returns a new calendar instance initialised from the specified URL
- Throws:
IOException- occurs when there is an error reading from the specified URLParserException- occurs when the data in the specified URL is invalid
-
merge
Merge all properties and components from multiple calendars into one instance. Note that the merge process is not very sophisticated, and may result in invalid calendar data (e.g. multiple properties of a type that should only be specified once).- Parameters:
calendars- zero or more calendars to merge- Returns:
- a Calendar instance containing all properties and components from the specified calendars
-
wrap
Wraps a component in a calendar.- Parameters:
component- the component to wrap with a calendar- Returns:
- a calendar containing the specified component
-
wrap
-
split
Deprecated.Splits a calendar object into distinct calendar objects for unique identifers (UID).- Parameters:
calendar- a calendar instance- Returns:
- an array of calendar objects
-
getUid
Deprecated.Returns a unique identifier as specified by components in the provided calendar.- Parameters:
calendar- a calendar instance- Returns:
- the UID property
- Throws:
ConstraintViolationException- if zero or more than one unique identifer is found in the specified calendar
-
getContentType
Deprecated.Returns an appropriate MIME Content-Type for the specified calendar object.- Parameters:
calendar- a calendar instancecharset- an optional encoding- Returns:
- a content type string
-