package io.vertx.ext.web.multipart.impl;
import io.vertx.ext.web.multipart.FormDataPart;
import io.vertx.ext.web.multipart.MultipartForm;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class MultipartFormImpl implements MultipartForm {
private final List<FormDataPart> parts = new ArrayList<>();
@Override
public MultipartForm attribute(String name, String value) {
parts.add(new FormDataPartImpl(name, value));
return this;
}
@Override
public MultipartForm textFileUpload(String name, String filename, String pathname, String mediaType) {
parts.add(new FormDataPartImpl(name, filename, pathname, mediaType, true));
return this;
}
@Override
public MultipartForm binaryFileUpload(String name, String filename, String pathname, String mediaType) {
parts.add(new FormDataPartImpl(name, filename, pathname, mediaType, false));
return this;
}
@Override
public Iterator<FormDataPart> iterator() {
return parts.iterator();
}
}