public boolean getBooleanConfig(String key, boolean default_value) { return asBoolean(this.config.get(key), default_value); }
public Map rename(String fromPublicId, String toPublicId, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); Map<String, Object> params = new HashMap<String, Object>(); params.put("type", (String) options.get("type")); params.put("overwrite", Cloudinary.asBoolean(options.get("overwrite"), false).toString()); params.put("from_public_id", fromPublicId); params.put("to_public_id", toPublicId); return callApi("rename", params, options, null); }
public Map destroy(String publicId, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); Map<String, Object> params = new HashMap<String, Object>(); params.put("type", (String) options.get("type")); params.put("public_id", publicId); params.put("invalidate", Cloudinary.asBoolean(options.get("invalidate"), false).toString()); return callApi("destroy", params, options, null); }
public Map addTag(String tag, String[] publicIds, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); boolean exclusive = Cloudinary.asBoolean(options.get("exclusive"), false); String command = exclusive ? "set_exclusive" : "add"; return callTagsApi(tag, command, publicIds, options); }
public Map multi(String tag, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); Map<String, Object> params = new HashMap<String, Object>(); Object transformation = options.get("transformation"); if (transformation != null) { if (transformation instanceof Transformation) { transformation = ((Transformation) transformation).generate(); } params.put("transformation", transformation.toString()); } params.put("tag", tag); params.put("notification_url", (String) options.get("notification_url")); params.put("format", (String) options.get("format")); params.put("async", Cloudinary.asBoolean(options.get("async"), false).toString()); return callApi("multi", params, options, null); }
params.put("type", (String) options.get("type")); for (String attr : BOOLEAN_UPLOAD_OPTIONS) { Boolean value = Cloudinary.asBoolean(options.get(attr), null); if (value != null) params.put(attr, value.toString());
public Map generate_sprite(String tag, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); Map<String, Object> params = new HashMap<String, Object>(); Object transParam = options.get("transformation"); Transformation transformation = null; if (transParam instanceof Transformation) { transformation = new Transformation((Transformation) transParam); } else if (transParam instanceof String) { transformation = new Transformation().rawTransformation((String) transParam); } else { transformation = new Transformation(); } String format = (String) options.get("format"); if (format != null) { transformation.fetchFormat(format); } params.put("transformation", transformation.generate()); params.put("tag", tag); params.put("notification_url", (String) options.get("notification_url")); params.put("async", Cloudinary.asBoolean(options.get("async"), false).toString()); return callApi("sprite", params, options, null); }
public String generate(Map options) { boolean isResponsive = Cloudinary.asBoolean(options.get("responsive_width"), defaultIsResponsive);
public Map callApi(String action, Map<String, Object> params, Map options, Object file) throws IOException { if (options == null) options = Cloudinary.emptyMap(); boolean returnError = Cloudinary.asBoolean(options.get("return_error"), false);