Class RequestUtils

java.lang.Object
org.opencastproject.index.service.util.RequestUtils

public final class RequestUtils extends Object
  • Field Details

  • Method Details

    • getKeyValueMap

      public static Map<String,String> getKeyValueMap(String json) throws org.json.simple.parser.ParseException
      Get a Map of metadata fields from a JSON array.
      Parameters:
      json - The json input.
      Returns:
      A Map of the metadata fields ids and values.
      Throws:
      org.json.simple.parser.ParseException - Thrown if the json is malformed.
    • typeIsAccepted

      public static boolean typeIsAccepted(String fileName, String assetUploadId, com.google.common.net.MediaType mediaType, org.opencastproject.list.api.ListProvidersService listProvidersService)
      Check if an uploaded asset conforms to the configured list of accepted file types.
      Parameters:
      assetUploadId - The id of the uploaded asset
      mediaType - The media type sent by the browser
      listProvidersService - The ListProviderService to get the configured accepted types from
      Returns:
      true if the given mediatype is accepted, false otherwise.