• Stars
    star
    160
  • Rank 234,703 (Top 5 %)
  • Language
    Java
  • License
    MIT License
  • Created about 12 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cloudinary Java Client Library

Build Status

Cloudinary

About

The Cloudinary Java SDK allows you to quickly and easily integrate your application with Cloudinary. Effortlessly optimize and transform your cloud's assets.

Additional documentation

This Readme provides basic installation and usage information. For the complete documentation, see the Java SDK Guide.

Table of Contents

Key Features

Version Support

SDK Version Java 6+
1.1.0 - 1.33.0 V

Installation

The cloudinary_java library is available in Maven Central. To use it, add the following dependency to your pom.xml :

<dependency>
    <groupId>com.cloudinary</groupId>
    <artifactId>cloudinary-http44</artifactId>
    <version>1.33.0</version>
</dependency>

Alternatively, download cloudinary_java from here and here and see build.gradle for library dependencies.

Usage

Setup

Each request for building a URL of a remote cloud resource must have the cloud_name parameter set. Each request to our secure APIs (e.g., image uploads, eager sprite generation) must have the api_key and api_secret parameters set. See API, URLs and access identifiers for more details.

Setting the cloud_name, api_key and api_secret parameters can be done either directly in each call to a Cloudinary method, by when initializing the Cloudinary object, or by using the CLOUDINARY_URL environment variable / system property.

The entry point of the library is the Cloudinary object.

Cloudinary cloudinary = new Cloudinary();

Here's an example of setting the configuration parameters programatically:

Map config = new HashMap();
config.put("cloud_name", "n07t21i7");
config.put("api_key", "123456789012345");
config.put("api_secret", "abcdeghijklmnopqrstuvwxyz12");
Cloudinary cloudinary = new Cloudinary(config);

Another example of setting the configuration parameters by providing the CLOUDINARY_URL value to the constructor:

Cloudinary cloudinary = new Cloudinary("cloudinary://123456789012345:abcdeghijklmnopqrstuvwxyz12@n07t21i7");

Transform and Optimize Assets

  • See full documentation Any image uploaded to Cloudinary can be transformed and embedded using powerful view helper methods:

The following example generates the url for accessing an uploaded sample image while transforming it to fill a 100x150 rectangle:

cloudinary.url().transformation(new Transformation().width(100).height(150).crop("fill")).generate("sample.jpg");

Another example, emedding a smaller version of an uploaded image while generating a 90x90 face detection based thumbnail:

cloudinary.url().transformation(new Transformation().width(90).height(90).crop("thumb").gravity("face")).generate("woman.jpg");

You can provide either a Facebook name or a numeric ID of a Facebook profile or a fan page.

Embedding a Facebook profile to match your graphic design is very simple:

cloudinary.url().type("facebook").transformation(new Transformation().width(130).height(130).crop("fill").gravity("north_west")).generate("billclinton.jpg");

File upload

Assuming you have your Cloudinary configuration parameters defined (cloud_name, api_key, api_secret), uploading to Cloudinary is very simple.

The following example uploads a local JPG to the cloud:

cloudinary.uploader().upload("my_picture.jpg", ObjectUtils.emptyMap());

The uploaded image is assigned a randomly generated public ID. The image is immediately available for download through a CDN:

cloudinary.url().generate("abcfrmo8zul1mafopawefg.jpg");

# http://res.cloudinary.com/demo/image/upload/abcfrmo8zul1mafopawefg.jpg

You can also specify your own public ID:

cloudinary.uploader().upload("http://www.example.com/image.jpg", ObjectUtils.asMap("public_id", "sample_remote"));

cloudinary.url().generate("sample_remote.jpg");

# http://res.cloudinary.com/demo/image/upload/sample_remote.jpg

Contributions

See contributing guidelines.

Get Help

About Cloudinary

Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiencesβ€”irrespective of the viewing device.

Additional Resources

Licence

Released under the MIT license.

More Repositories

1

cloudinary_npm

Cloudinary NPM for node.js integration
JavaScript
623
star
2

cloudinary-react

React components that utilize Cloudinary functionality
JavaScript
500
star
3

responsive_breakpoints_generator

JavaScript
437
star
4

cloudinary_gem

Cloudinary GEM for Ruby on Rails integration
Ruby
420
star
5

cloudinary_php

PHP extension for Cloudinary
PHP
380
star
6

cloudinary_js

Cloudinary JavaScript library
CSS
328
star
7

cloudinary_angular

Cloudinary Angular client library
TypeScript
305
star
8

pycloudinary

Python package for cloudinary
Python
249
star
9

cloudinary_ios

Cloudinary iOS SDK
Swift
164
star
10

fuif

Free Universal Image Format
C++
163
star
11

ssimulacra2

SSIMULACRA 2. Perceptual metric.
C++
141
star
12

cloudinary-vue

Cloudinary components library for Vue.js application, for image and video optimization.
JavaScript
99
star
13

CloudinaryDotNet

Cloudinary DotNet library
C#
98
star
14

ssimulacra

C++
93
star
15

cloudinary-video-player

Cloudinary Video Player
JavaScript
70
star
16

cloudinary_android

Android client for integrating with Cloudinary
Java
66
star
17

pkg-cloudinary-core

Distribution repository for the Cloudinary JavaScript library. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
54
star
18

js-url-gen

Cloudinary's base javascript library, including URL generation.
HTML
47
star
19

frontend-frameworks

Cloudinary javascript frontend frameworks SDKs, including Shared HTML layer, Angular, React and Vue SDKs
TypeScript
41
star
20

cloudinary_wordpress

Cloudinary's WordPress plugin
PHP
39
star
21

cloudinary-go

Cloudinary Golang package
Go
36
star
22

cloudinary_android_parse_sample

Sample Android photo album app with Cloudinary using Parse as backend
Java
24
star
23

cloudinary_parse

Cloudinary Parse Module for easy integration
JavaScript
22
star
24

cloudinary_pubnub_demo

Demo for uploading images to Cloudinary and sharing them in real-time using PubNub
JavaScript
18
star
25

cloudinary-cli

A command line interface for Cloudinary's APIs
Python
17
star
26

cloudinary-svelte

Cloudinary components library for Svelte
JavaScript
17
star
27

cloudinary_scala

Cloudinary Scala Client Library
Scala
16
star
28

cloudinary_magento

Cloudinary's Magento extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
PHP
16
star
29

wdio-allure-ts

WebdriverIO, Allure reporter and TypeScript wrapper for UI E2E testing
TypeScript
15
star
30

cloudinary_magento2

Cloudinary's Magento 2 extension. Upload product images to the cloud, manipulate them to match your graphic design and optimize images for better user experience
PHP
15
star
31

pkg-cloudinary-jquery

Distribution repository for the Cloudinary JavaScript library and jQuery Plugin. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
11
star
32

cloudinary_kotlin

Cloudinary Kotlin SDK library
Kotlin
10
star
33

cloudinary_sap_commerce

Cloudinary's SAP Commerce Extension
Java
9
star
34

android-demo

Java
9
star
35

cloudinary-react-native

TypeScript
9
star
36

pkg-cloudinary-jquery-file-upload

Distribution repository for the Cloudinary jQuery File Upload library. Cloudinary is an end-to-end solution for all your image and video needs.
JavaScript
9
star
37

web-speed-test-server

Page Speed Image Performance Analysis (Server)
JavaScript
8
star
38

web-speed-test-client

Page Speed Image Performance Analysis
JavaScript
8
star
39

cloudinary_sfcc_pagedesigner

Cloudinary Salesforce PageDesigner Integration
JavaScript
8
star
40

cloudinary_dart

Dart
7
star
41

bower-cloudinary

Cloudinary JavaScript bower package
JavaScript
6
star
42

cloudinary-js-streaming

Cloudinary Live Streaming Javascript SDK
JavaScript
6
star
43

cloudinary_flutter

Dart
6
star
44

cloudinary_tinymce

TinyMCE plugin for adding and manipulating images from Cloudinary's cloud-based media library
JavaScript
5
star
45

php-transformation-builder-sdk

Cloudinary PHP Transformation Builder SDK
PHP
3
star
46

mailinary

scrape and email web pages on schedule or on demand
JavaScript
3
star
47

cloudinary_titanium

Cloudinary integration library for Appcelerator Titanium
JavaScript
3
star
48

cloudinary_sfcc_site_cartridge

Salesforce Commerce Cloud integration
JavaScript
3
star
49

cloudinary-video-analytics

JavaScript
2
star
50

cloudinary-ios-sample-app

Cloudinary iOS sample application
Swift
2
star
51

product-customization-sample-app

JavaScript
2
star
52

imagemagick_blog

Complementary source code to Cloudinary's ImageMagick blog post
Ruby
2
star
53

cloudinary_chrome_extension

Cloudinary's Chrome extension for web developers
2
star
54

cloudinary_cake_php

Cloudinary CakePHP module
PHP
2
star
55

js-transformation-builder-sdk

TypeScript
2
star
56

media-management-js

JavaScript
2
star
57

vue-cli-plugin-cloudinary

Plugin of Cloudinary Vue SDK for Vue CLI
JavaScript
2
star
58

media-editing-js

JavaScript
1
star
59

cloudinaryNodeMongo

Upload images to Cloudinary and display previously uploaded images in a grid
JavaScript
1
star
60

cloudinary-live-demo

JavaScript
1
star
61

cloudinary_commercetools

Cloudinary demo for Commercetools
TypeScript
1
star
62

live-streaming-demo

Demo of live video streaming using video streaming sdk
JavaScript
1
star
63

account-provisioning-php

Cloudinary Account Provisioning PHP SDK
PHP
1
star
64

media-editing-api-php

Cloudinary Media Editing API PHP SDK
PHP
1
star
65

media-editing-java

1
star