@@ -323,40 +323,133 @@ public Map explode(String public_id, Map options) throws IOException {
323323 return callApi ("explode" , params , options , null );
324324 }
325325
326- // options may include 'exclusive' (boolean) which causes clearing this tag
327- // from all other resources
326+ /**
327+ * Add a tag to one or more assets in your cloud.
328+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
329+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
330+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
331+ * @param tag - The tag to assign.
332+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
333+ * @param options - An object holding the available parameters for the request.
334+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
335+ * @return A map with the public ids returned from the server
336+ * @throws IOException
337+ */
328338 public Map addTag (String tag , String [] publicIds , Map options ) throws IOException {
339+ return addTag (new String []{tag }, publicIds , options );
340+ }
341+
342+ /**
343+ * Add a tag to one or more assets in your cloud.
344+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
345+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
346+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
347+ * @param tag - An array of tags to assign.
348+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
349+ * @param options - An object holding the available parameters for the request.
350+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
351+ * @return A map with the public ids returned from the server.
352+ * @throws IOException
353+ */
354+ public Map addTag (String [] tag , String [] publicIds , Map options ) throws IOException {
329355 if (options == null )
330356 options = ObjectUtils .emptyMap ();
331357 boolean exclusive = ObjectUtils .asBoolean (options .get ("exclusive" ), false );
332358 String command = exclusive ? "set_exclusive" : Command .add ;
333359 return callTagsApi (tag , command , publicIds , options );
334360 }
335361
362+ /**
363+ * Remove a tag to one or more assets in your cloud.
364+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
365+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
366+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
367+ * @param tag - The tag to remove.
368+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
369+ * @param options - An object holding the available parameters for the request.
370+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
371+ * @return - A map with the public ids returned from the server.
372+ * @throws IOException
373+ */
336374 public Map removeTag (String tag , String [] publicIds , Map options ) throws IOException {
375+ return removeTag (new String []{tag }, publicIds , options );
376+ }
377+
378+ /**
379+ * Remove tags to one or more assets in your cloud.
380+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
381+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
382+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
383+ * @param tag - The array of tags to remove.
384+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
385+ * @param options - An object holding the available parameters for the request.
386+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
387+ * @return - * @return - A map with the public ids returned from the server.
388+ * @throws IOException
389+ */
390+ public Map removeTag (String [] tag , String [] publicIds , Map options ) throws IOException {
337391 if (options == null )
338392 options = ObjectUtils .emptyMap ();
339393 return callTagsApi (tag , Command .remove , publicIds , options );
340394 }
341395
396+ /**
397+ * Remove an array of tags to one or more assets in your cloud.
398+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
399+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
400+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
401+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
402+ * @param options - An object holding the available parameters for the request.
403+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
404+ * @return - * @return - A map with the public ids returned from the server.
405+ * @throws IOException
406+ */
342407 public Map removeAllTags (String [] publicIds , Map options ) throws IOException {
343408 if (options == null )
344409 options = ObjectUtils .emptyMap ();
345410 return callTagsApi (null , Command .removeAll , publicIds , options );
346411 }
347412
413+ /**
414+ * Replaces a tag to one or more assets in your cloud.
415+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
416+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
417+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
418+ * @param tag - The tag to replace.
419+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
420+ * @param options - An object holding the available options for the request.
421+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
422+ * @return - A map with the public ids returned from the server.
423+ * @throws IOException
424+ */
348425 public Map replaceTag (String tag , String [] publicIds , Map options ) throws IOException {
426+ return replaceTag (new String []{tag }, publicIds , options );
427+ }
428+
429+ /**
430+ * Replaces tags to one or more assets in your cloud.
431+ * Tags are used to categorize and organize your images, and can also be used to apply group actions to images,
432+ * for example to delete images, create sprites, ZIP files, JSON lists, or animated GIFs.
433+ * Each image can be assigned one or more tags, which is a short name that you can dynamically use (no need to predefine tags).
434+ * @param tag - An array of tag to replace.
435+ * @param publicIds - An array of Public IDs of images uploaded to Cloudinary.
436+ * @param options - An object holding the available options for the request.
437+ * options may include 'exclusive' (boolean) which causes clearing this tag from all other resources
438+ * @return - A map with the public ids returned from the server.
439+ * @throws IOException
440+ */
441+ public Map replaceTag (String [] tag , String [] publicIds , Map options ) throws IOException {
349442 if (options == null )
350443 options = ObjectUtils .emptyMap ();
351444 return callTagsApi (tag , Command .replace , publicIds , options );
352445 }
353446
354- public Map callTagsApi (String tag , String command , String [] publicIds , Map options ) throws IOException {
447+ public Map callTagsApi (String [] tag , String command , String [] publicIds , Map options ) throws IOException {
355448 if (options == null )
356449 options = ObjectUtils .emptyMap ();
357450 Map <String , Object > params = new HashMap <String , Object >();
358451 if (tag != null ) {
359- params .put ("tag" , tag );
452+ params .put ("tag" , StringUtils . join ( tag , "," ) );
360453 }
361454 params .put ("command" , command );
362455 params .put ("type" , (String ) options .get ("type" ));
0 commit comments