cloudinary/cloudinary_java

How to delete image? Merci

qamalyanaren opened this issue · 2 comments

How to delete image? Merci

Hi @Fkut,
Deleting images can be done by Admin API.

First, initialize the Api object:

import com.cloudinary.*;
import com.cloudinary.utils.*;
Map config = ObjectUtils.asMap(
  "cloud_name", "my_cloud_name",
  "api_key", "my_api_key",
  "api_secret", "my_api_secret");
Cloudinary cloudinary = new Cloudinary(config);
Api api = cloudinary.api();

And then call deleteResources

api.deleteResources(Arrays.asList("public_id1", "public_id2"),
    ObjectUtils.emptyMap());

You can read more about it here.

Tankx, it works well