Tabnine Logo
Util
Code IndexAdd Tabnine to your IDE (free)

How to use
Util
in
com.cloudinary

Best Java code snippets using com.cloudinary.Util (Showing top 20 results out of 315)

origin: com.cloudinary/cloudinary

public ApiResponse updateUploadPreset(String name, Map options) throws Exception {
  if (options == null) options = Cloudinary.emptyMap();
  Map params = Util.buildUploadParams(options);
  Util.clearEmpty(params);
  params.putAll(Cloudinary.only(options, "unsigned", "disallow_public_id"));
  return callApi(HttpMethod.PUT, Arrays.asList("upload_presets", name), params, options);
}
origin: com.cloudinary/cloudinary-core

@SuppressWarnings("unchecked")
public static final void processWriteParameters(Map<String, Object> options, Map<String, Object> params) {
  if (options.get("headers") != null)
    params.put("headers", buildCustomHeaders(options.get("headers")));
  if (options.get("tags") != null)
    params.put("tags", StringUtils.join(ObjectUtils.asArray(options.get("tags")), ","));
  if (options.get("face_coordinates") != null)
    params.put("face_coordinates", Coordinates.parseCoordinates(options.get("face_coordinates")).toString());
  if (options.get("custom_coordinates") != null)
    params.put("custom_coordinates", Coordinates.parseCoordinates(options.get("custom_coordinates")).toString());
  if (options.get("context") != null)
    params.put("context", encodeContext(options.get("context")));
  if (options.get("access_control") != null) {
    params.put("access_control", encodeAccessControl(options.get("access_control")));
  }
  putObject("ocr", options, params);
  putObject("raw_convert", options, params);
  putObject("categorization", options, params);
  putObject("detection", options, params);
  putObject("similarity_search", options, params);
  putObject("background_removal", options, params);
  if (options.get("auto_tagging") != null)
    params.put("auto_tagging", ObjectUtils.asFloat(options.get("auto_tagging")));
}
origin: com.cloudinary/cloudinary-core

private static void putEager(String name, Map from, Map<String, Object> to) {
  final Object transformations = from.get(name);
  if (transformations != null)
    to.put(name, buildEager((List<Transformation>) transformations));
}
origin: com.cloudinary/cloudinary-core

public void signRequest(Map<String, Object> params, Map<String, Object> options) {
  String apiKey = ObjectUtils.asString(options.get("api_key"), this.config.apiKey);
  if (apiKey == null)
    throw new IllegalArgumentException("Must supply api_key");
  String apiSecret = ObjectUtils.asString(options.get("api_secret"), this.config.apiSecret);
  if (apiSecret == null)
    throw new IllegalArgumentException("Must supply api_secret");
  Util.clearEmpty(params);
  params.put("signature", this.apiSignRequest(params, apiSecret));
  params.put("api_key", apiKey);
}
origin: cloudinary/cloudinary_java

params.put("type", (String) options.get("type"));
for (String attr : BOOLEAN_UPLOAD_OPTIONS) {
  putBoolean(attr, options, params);
  putEager("eager", options, params);
  Object transformation = options.get("transformation");
  if (transformation != null) {
  processWriteParameters(options, params);
} else {
origin: com.cloudinary/cloudinary

public Map explicit(String publicId, Map options) throws IOException {
  if (options == null) options = Cloudinary.emptyMap();
  Map<String, Object> params = new HashMap<String, Object>();
  params.put("public_id", publicId);
  params.put("callback", (String) options.get("callback"));
  params.put("type", (String) options.get("type"));
  params.put("eager", Util.buildEager((List<Transformation>) options.get("eager")));
  params.put("headers", Util.buildCustomHeaders(options.get("headers")));
  params.put("tags", StringUtils.join(Cloudinary.asArray(options.get("tags")), ","));
  if (options.get("face_coordinates") != null) {
    params.put("face_coordinates", Coordinates.parseCoordinates(options.get("face_coordinates")).toString());
  }
  if (options.get("custom_coordinates") != null) {
    params.put("custom_coordinates", Coordinates.parseCoordinates(options.get("custom_coordinates")).toString());
  }
  if (options.get("context") != null) {
    params.put("context", Cloudinary.encodeMap(options.get("context")));
  }
  return callApi("explicit", params, options, null);
}
origin: com.cloudinary/cloudinary

    params.put(attr, value.toString());            
params.put("eager", buildEager((List<Transformation>) options.get("eager")));
params.put("notification_url", (String) options.get("notification_url"));
params.put("eager_notification_url", (String) options.get("eager_notification_url"));
params.put("upload_preset", options.get("upload_preset"));
processWriteParameters(options, params);
return params;
origin: com.cloudinary/cloudinary-core

public ApiResponse update(String public_id, Map options) throws Exception {
  if (options == null) options = ObjectUtils.emptyMap();
  String resourceType = ObjectUtils.asString(options.get("resource_type"), "image");
  String type = ObjectUtils.asString(options.get("type"), "upload");
  Map params = new HashMap<String, Object>();
  Util.processWriteParameters(options, params);
  params.put("moderation_status", options.get("moderation_status"));
  params.put("notification_url", options.get("notification_url"));
  ApiResponse response = callApi(HttpMethod.POST, Arrays.asList("resources", resourceType, type, public_id),
      params, options);
  return response;
}
origin: cloudinary/cloudinary_java

protected Map callContextApi(Map context, String command, String[] publicIds, Map options) throws IOException {
  return callContextApi(Util.encodeContext(context), command, publicIds, options);
}
origin: cloudinary/cloudinary_java

public Map<String, Object> buildUploadParams(Map options) {
  return Util.buildUploadParams(options);
}
origin: com.cloudinary/cloudinary

protected static final void processWriteParameters(
    Map<String, Object> options, Map<String, Object> params) {
  if (options.get("headers") != null)
    params.put("headers", buildCustomHeaders(options.get("headers")));
  if (options.get("tags") != null)
    params.put("tags", StringUtils.join(
origin: com.cloudinary/cloudinary-core

public Map createArchive(Map options, String targetFormat) throws IOException {
  Map params = Util.buildArchiveParams(options, targetFormat);
  return callApi("generate_archive", params, options, null);
}
origin: cloudinary/cloudinary_java

public void signRequest(Map<String, Object> params, Map<String, Object> options) {
  String apiKey = ObjectUtils.asString(options.get("api_key"), this.config.apiKey);
  if (apiKey == null)
    throw new IllegalArgumentException("Must supply api_key");
  String apiSecret = ObjectUtils.asString(options.get("api_secret"), this.config.apiSecret);
  if (apiSecret == null)
    throw new IllegalArgumentException("Must supply api_secret");
  Util.clearEmpty(params);
  params.put("signature", this.apiSignRequest(params, apiSecret));
  params.put("api_key", apiKey);
}
origin: com.cloudinary/cloudinary-core

params.put("type", (String) options.get("type"));
for (String attr : BOOLEAN_UPLOAD_OPTIONS) {
  putBoolean(attr, options, params);
  putEager("eager", options, params);
  Object transformation = options.get("transformation");
  if (transformation != null) {
  processWriteParameters(options, params);
} else {
origin: com.cloudinary/cloudinary

public ApiResponse update(String public_id, Map options) throws Exception {
  if (options == null) options = Cloudinary.emptyMap();
  String resourceType = Cloudinary.asString(options.get("resource_type"), "image");
  String type = Cloudinary.asString(options.get("type"), "upload");
  Map params = new HashMap<String, Object>();
  Util.processWriteParameters(options, params);
  params.put("moderation_status", options.get("moderation_status"));
  return callApi(HttpMethod.POST, Arrays.asList("resources", resourceType, type, public_id), 
      params, options);
}
origin: com.cloudinary/cloudinary-core

protected Map callContextApi(Map context, String command, String[] publicIds, Map options) throws IOException {
  return callContextApi(Util.encodeContext(context), command, publicIds, options);
}
origin: com.cloudinary/cloudinary-core

public Map<String, Object> buildUploadParams(Map options) {
  return Util.buildUploadParams(options);
}
origin: cloudinary/cloudinary_java

public Map createArchive(Map options, String targetFormat) throws IOException {
  Map params = Util.buildArchiveParams(options, targetFormat);
  return callApi("generate_archive", params, options, null);
}
origin: com.cloudinary/cloudinary

public ApiResponse createUploadPreset(Map options) throws Exception {
  if (options == null) options = Cloudinary.emptyMap();
  Map params = Util.buildUploadParams(options);
  Util.clearEmpty(params);
  params.putAll(Cloudinary.only(options, "name", "unsigned", "disallow_public_id"));
  return callApi(HttpMethod.POST,  Arrays.asList("upload_presets"), params, options);
}

origin: com.cloudinary/cloudinary

public void signRequest(Map<String, Object> params, Map<String, Object> options) {
  String apiKey = Cloudinary.asString(options.get("api_key"), this.getStringConfig("api_key"));
  if (apiKey == null)
    throw new IllegalArgumentException("Must supply api_key");
  String apiSecret = Cloudinary.asString(options.get("api_secret"), this.getStringConfig("api_secret"));
  if (apiSecret == null)
    throw new IllegalArgumentException("Must supply api_secret");
  Util.clearEmpty(params);
  params.put("signature", this.apiSignRequest(params, apiSecret));
  params.put("api_key", apiKey);
}
com.cloudinaryUtil

Most used methods

  • clearEmpty
  • buildCustomHeaders
  • buildEager
  • buildUploadParams
  • encodeContext
  • processWriteParameters
  • buildArchiveParams
  • encodeAccessControl
  • putArray
  • putBoolean
  • putEager
  • putObject
  • putEager,
  • putObject,
  • timestamp

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now