Package org.opencastproject.oaipmh
Class OaiPmhUtil
java.lang.Object
org.opencastproject.oaipmh.OaiPmhUtil
General purpose functions for OAI-PMH.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GranularityConvert from a OAI representation.static DateConvert to a date from a UTC string with either day or second granularity.static DateFormatstatic DateFormatstatic Stringstatic StringtoUtc(Date d, Granularity g) Convert a date into a UTC string of the given granularity.static StringConvert to a UTC date string containing only the day (granularity is "day").static StringtoUtcSecond(Date d) Convert to a UTC date and time string (granularity is "second").
-
Method Details
-
toUtc
Convert a date into a UTC string of the given granularity. -
toUtcSecond
Convert to a UTC date and time string (granularity is "second"). -
toUtcDay
Convert to a UTC date string containing only the day (granularity is "day"). -
fromUtc
Convert to a date from a UTC string with either day or second granularity.- Throws:
ParseException- malformed date string
-
newDateTimeFormat
-
newDateFormat
-
fromOaiRepresentation
Convert from a OAI representation. See the spec for further details.- Throws:
IllegalArgumentException- oai is not valid representation
-
toOaiRepresentation
-