/** * Set a custom action, such as a call to a lambda function or a web-assembly function. * @param action The custom action to perform, see {@link CustomFunction}. * @return The transformation for chaining */ public T customFunction(CustomFunction action) { return param("custom_function", action.toString()); } }
public Map upload(Object file, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); Map<String, Object> params = buildUploadParams(options); return callApi("upload", params, options, file); }
/** * Get a Cloudinary Url object used to construct urls to access and transform pre-uploaded resources. */ public Url url() { Url url = cloudinary.url(); // set https as default for android P and up - in P the default policy fails all http // requests if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { url.secure(true); } return url; }
private static Map uploadResource(String publicId) throws IOException { return new Cloudinary().uploader().upload(SRC_TEST_IMAGE, asMap( "public_id", publicId, "tags", new String[]{SDK_TEST_TAG, CONTEXT_TAG}, "context", CONTEXT, "transformation", new Transformation().crop("scale").width(10))); }
public String downloadArchive(ArchiveParams params) throws UnsupportedEncodingException { return downloadArchive(params.toMap(), params.targetFormat()); }
public Map createArchive(ArchiveParams params) throws IOException { return createArchive(params.toMap(), params.targetFormat()); }
public Map createArchive(Map options, String targetFormat) throws IOException { Map params = Util.buildArchiveParams(options, targetFormat); return callApi("generate_archive", params, options, null); }
public Cloudinary(Map config) { this.config = new Configuration(config); loadStrategies(); }
public Cloudinary(String cloudinaryUrl) { this.config = Configuration.from(cloudinaryUrl); loadStrategies(); }
public Map removeTag(String tag, String[] publicIds, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); return callTagsApi(tag, "remove", publicIds, options); }
/** * Construct a new anonymous access rule * @param end The end date for the rule * @return The access rule instance */ public static AccessControlRule anonymousUntil(Date end){ return new AccessControlRule(AccessType.anonymous, null, end); }
public ResponsiveBreakpoint maxImages(Integer maxImages) { put("max_images", maxImages); return this; } }
/** * Set a custom action, such as a call to a lambda function or a web-assembly function. * @param action The custom action to perform, see {@link CustomFunction}. * @return The transformation for chaining */ public T customFunction(CustomFunction action) { return param("custom_function", action.toString()); } }
public Map createArchive(Map options, String targetFormat) throws IOException { Map params = Util.buildArchiveParams(options, targetFormat); return callApi("generate_archive", params, options, null); }
public Cloudinary(Map config) { this.config = new Configuration(config); loadStrategies(); }
public Cloudinary(String cloudinaryUrl) { this.config = Configuration.from(cloudinaryUrl); loadStrategies(); }
public Map replaceTag(String tag, String[] publicIds, Map options) throws IOException { if (options == null) options = Cloudinary.emptyMap(); return callTagsApi(tag, "replace", publicIds, options); }