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

top.jfunc.http.holder.DefaultFormFileHolder Maven / Gradle / Ivy

package top.jfunc.http.holder;

import top.jfunc.http.base.FormFile;
import top.jfunc.common.utils.ArrayUtil;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author xiongshiyan at 2019/6/2 , contact me with email [email protected] or phone 15208384257
 */
public class DefaultFormFileHolder implements FormFileHolder {
    /**
     * 2018-06-18为了文件上传增加的
     */
    private List formFiles = new ArrayList<>(2);

    @Override
    public Iterable getFormFiles() {
        return this.formFiles;
    }

    @Override
    public FormFileHolder addFormFile(FormFile... formFiles) {
        if(ArrayUtil.isNotEmpty(formFiles)){
            this.formFiles.addAll(Arrays.asList(formFiles));
        }
        return this;
    }

    @Override
    public FormFileHolder addFormFiles(Iterable formFiles) {
        if(null != formFiles){
            formFiles.forEach(this.formFiles::add);
        }
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy