Class RequestUtils
java.lang.Object
org.opencastproject.index.service.util.RequestUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetKeyValueMap(String json) Get aMapof metadata fields from a JSON array.static booleantypeIsAccepted(String fileName, String assetUploadId, com.google.common.net.MediaType mediaType, ListProvidersService listProvidersService) Check if an uploaded asset conforms to the configured list of accepted file types.
-
Field Details
-
ID_JSON_KEY
- See Also:
-
VALUE_JSON_KEY
- See Also:
-
REQUIRED_JSON_KEY
- See Also:
-
-
Method Details
-
getKeyValueMap
public static Map<String,String> getKeyValueMap(String json) throws org.json.simple.parser.ParseException Get aMapof metadata fields from a JSON array.- Parameters:
json- The json input.- Returns:
- A
Mapof 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, ListProvidersService listProvidersService) Check if an uploaded asset conforms to the configured list of accepted file types.- Parameters:
assetUploadId- The id of the uploaded assetmediaType- The media type sent by the browserlistProvidersService- The ListProviderService to get the configured accepted types from- Returns:
- true if the given mediatype is accepted, false otherwise.
-