Class DublinCoreUtil

java.lang.Object
org.opencastproject.metadata.dublincore.DublinCoreUtil

public final class DublinCoreUtil extends Object
Utility functions for DublinCores.
  • Method Details

    • loadEpisodeDublinCore

      public static Optional<DublinCoreCatalog> loadEpisodeDublinCore(Workspace workspace, MediaPackage mediaPackage)
      Load the episode DublinCore catalog contained in a media package.
      Returns:
      the catalog or none if the media package does not contain an episode DublinCore
    • loadDublinCore

      public static DublinCoreCatalog loadDublinCore(Workspace workspace, MediaPackageElement mpe)
      Load the DublinCore catalog identified by mpe. Throws an exception if it does not exist or cannot be loaded by any reason.
      Returns:
      the catalog
    • equals

      public static boolean equals(DublinCoreCatalog a, DublinCoreCatalog b)
      Define equality on DublinCoreCatalogs. Two DublinCores are considered equal if they have the same properties and if each property has the same values in the same order.

      Note: As long as http://opencast.jira.com/browse/MH-8759 is not fixed, the encoding scheme of values is not considered.

      Implementation Note: DublinCores should not be compared by their string serialization since the ordering of properties is not defined and cannot be guaranteed between serializations.

    • getPropertiesSorted

      public static List<XMLCatalogImpl.CatalogEntry> getPropertiesSorted(DublinCoreCatalog dc)
      Return a sorted list of all catalog entries.
    • calculateChecksum

      public static Checksum calculateChecksum(DublinCoreCatalog dc)
      Calculate an MD5 checksum for a DublinCore catalog.