Class OaiPmhUtil

java.lang.Object
org.opencastproject.oaipmh.OaiPmhUtil

public final class OaiPmhUtil extends Object
General purpose functions for OAI-PMH.
  • Method Details

    • toUtc

      public static String toUtc(Date d, Granularity g)
      Convert a date into a UTC string of the given granularity.
    • toUtcSecond

      public static String toUtcSecond(Date d)
      Convert to a UTC date and time string (granularity is "second").
    • toUtcDay

      public static String toUtcDay(Date d)
      Convert to a UTC date string containing only the day (granularity is "day").
    • fromUtc

      public static Date fromUtc(String d) throws ParseException
      Convert to a date from a UTC string with either day or second granularity.
      Throws:
      ParseException - malformed date string
    • newDateTimeFormat

      public static DateFormat newDateTimeFormat()
    • newDateFormat

      public static DateFormat newDateFormat()
    • fromOaiRepresentation

      public static Granularity fromOaiRepresentation(String oai)
      Convert from a OAI representation. See the spec for further details.
      Throws:
      IllegalArgumentException - oai is not valid representation
    • toOaiRepresentation

      public static String toOaiRepresentation(Granularity g)