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

com.smartystreets.api.LicenseSender Maven / Gradle / Ivy

There is a newer version: 3.18.3
Show newest version
package com.smartystreets.api;


import com.smartystreets.api.exceptions.SmartyException;

import java.io.IOException;
import java.util.List;

public class LicenseSender implements Sender{
    private List licenses;
    private Sender inner;

    public LicenseSender(List licenses, Sender inner) {
        this.licenses = licenses;
        this.inner = inner;
    }

    public Response send(Request request) throws IOException, SmartyException, InterruptedException {
        if (!this.licenses.isEmpty()) {
            StringBuilder licenses = new StringBuilder();
            for (String license : this.licenses)
            {
                licenses.append(license);
                licenses.append(",");
            }
            request.putParameter("license", licenses.toString());
        }
        return this.inner.send(request);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy