Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

teamcarma/cloudinary-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Cloudinary Integration for Java.

Initialization:

private static final Cloudinary CLOUDINARY = new Cloudinary(new CloudinaryRepository(REPO_NAME, SECRET_KEY, API_KEY));

Upload:

byte[] existingPhotoBytes = IOUtils.toByteArray(photo.getPhotoStream());
String publicId;

try {
	publicId = CLOUDINARY.postPhotoToCloudinary(existingPhotoBytes, photo.getMimeType());
} catch (CloudinaryException e) {
	throw new CDNException("Exception occured while attempting to Upload Existing Photo to Cloudinary.", e);
}

Download:

try {
	return CLOUDINARY.buildCloudinaryPhotoURI(remoteImageKey, mimeType, width, height);
} catch (CloudinaryException e) {
	throw new CDNException("Exception occured while attempting to build Cloudinary URL.", e);
}

Deletion:

try {
	CLOUDINARY.deleteImageFromCloudinary(remoteImageKey);
catch (CloudinaryException e) {
	throw new CDNException("Exception occured while attempting to Delete Existing Photo from Cloudinary.", e);
}

License

Released under the MIT license.

About

Cloudinary Integration for Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages