@@ -245,32 +245,11 @@ public Map rename(String fromPublicId, String toPublicId, Map options) throws IO
245245 }
246246
247247 public Map explicit (String publicId , Map options ) throws IOException {
248- if (options == null )
248+ if (options == null ) {
249249 options = ObjectUtils .emptyMap ();
250- Map <String , Object > params = new HashMap <String , Object >();
251- params .put ("public_id" , publicId );
252- params .put ("callback" , (String ) options .get ("callback" ));
253- params .put ("type" , (String ) options .get ("type" ));
254- params .put ("eager" , Util .buildEager ((List <Transformation >) options .get ("eager" )));
255- params .put ("eager_async" , ObjectUtils .asBoolean (options .get ("eager_async" ), false ).toString ());
256- params .put ("eager_notification_url" , (String ) options .get ("eager_notification_url" ));
257- params .put ("headers" , Util .buildCustomHeaders (options .get ("headers" )));
258- params .put ("tags" , StringUtils .join (ObjectUtils .asArray (options .get ("tags" )), "," ));
259- params .put ("moderation" , (String ) options .get ("moderation" ));
260- params .put ("ocr" , (String ) options .get ("ocr" ));
261- if (options .get ("face_coordinates" ) != null ) {
262- params .put ("face_coordinates" , Coordinates .parseCoordinates (options .get ("face_coordinates" )).toString ());
263- }
264- if (options .get ("custom_coordinates" ) != null ) {
265- params .put ("custom_coordinates" , Coordinates .parseCoordinates (options .get ("custom_coordinates" )).toString ());
266250 }
267- if (options .get ("context" ) != null ) {
268- params .put ("context" , Util .encodeContext (options .get ("context" )));
269- }
270- if (options .get ("responsive_breakpoints" ) != null ) {
271- params .put ("responsive_breakpoints" , JSONObject .wrap (options .get ("responsive_breakpoints" )));
272- }
273- params .put ("invalidate" , ObjectUtils .asBoolean (options .get ("invalidate" ), false ).toString ());
251+ Map <String , Object > params = buildUploadParams (options );
252+ params .put ("public_id" , publicId );
274253 return callApi ("explicit" , params , options , null );
275254 }
276255
0 commit comments