All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudinary.EagerTransformation Maven / Gradle / Ivy

Go to download

Cloudinary is a cloud service that offers a solution to a web application's entire image management pipeline. Upload images to the cloud. Automatically perform smart image resizing, cropping and conversion without installing any complex software. Integrate Facebook or Twitter profile image extraction in a snap, in any dimension and style to match your website’s graphics requirements. Images are seamlessly delivered through a fast CDN, and much much more. This Java library allows to easily integrate with Cloudinary in Java applications.

The newest version!
package com.cloudinary;

import com.cloudinary.utils.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class EagerTransformation extends Transformation {
    protected String format;

    @SuppressWarnings("rawtypes")
    public EagerTransformation(List transformations) {
        super(transformations);
    }

    public EagerTransformation() {
        super();
    }

    public EagerTransformation format(String format) {
        this.format = format;
        return this;
    }

    public String getFormat() {
        return format;
    }

    @Override
    public String generate(Iterable optionsList) {
        List components = new ArrayList();
        for (Map options : optionsList) {
            if (options.size() > 0) {
                components.add(super.generate(options));
            }
        }

        if (format != null){
            components.add(format);
        }

        return StringUtils.join(components, "/");
    }

    @Override
    public String generate(Map options) {
        List eager = new ArrayList();
        eager.add(super.generate(options));

        if (format != null){
            eager.add(format);
        }

        return StringUtils.join(eager, "/");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy