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

com.mailgun.form.SingleFormDataWriter Maven / Gradle / Ivy

Go to download

The Mailgun SDK for Java enables Java developers to work with Mailgun API efficiently.

The newest version!
package com.mailgun.form;

import feign.codec.EncodeException;
import feign.form.FormData;
import feign.form.multipart.AbstractWriter;
import feign.form.multipart.Output;
import lombok.val;

public class SingleFormDataWriter extends AbstractWriter {

    @Override
    public boolean isApplicable (Object value) {
        return value instanceof FormData;
    }

    @Override
    protected void write(Output output, String key, Object value) throws EncodeException {
        val formData = (FormData) value;
        writeFileMetadata(output, key, formData.getFileName(), formData.getContentType());
        output.write(formData.getData());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy