Cloudinary cloudinary = new Cloudinary();
if (cloudinary.getStringConfig("api_secret") == null) {
System.err.println("Please setup environment for Upload test to run");
return;
}
Api api = cloudinary.api();
try {
api.deleteResources(Arrays.asList("api_test", "api_test1", "api_test2", "api_test3", "api_test5"), Cloudinary.emptyMap());
} catch (Exception e) {
}
try {
api.deleteTransformation("api_test_transformation", Cloudinary.emptyMap());
} catch (Exception e) {
}
try {
api.deleteTransformation("api_test_transformation2", Cloudinary.emptyMap());
} catch (Exception e) {
}
try {
api.deleteTransformation("api_test_transformation3", Cloudinary.emptyMap());
} catch (Exception e) {
}
try{api.deleteUploadPreset("api_test_upload_preset", Cloudinary.emptyMap());}catch (Exception e) {}
try{api.deleteUploadPreset("api_test_upload_preset2", Cloudinary.emptyMap());}catch (Exception e) {}
try{api.deleteUploadPreset("api_test_upload_preset3", Cloudinary.emptyMap());}catch (Exception e) {}
try{api.deleteUploadPreset("api_test_upload_preset4", Cloudinary.emptyMap());}catch (Exception e) {}
Map options = Cloudinary.asMap(
"public_id", "api_test",
"tags", new String[]{"api_test_tag", uniqueTag},
"context", "key=value",
"eager", Collections.singletonList(new Transformation().width(100).crop("scale")));