io.vertx.up.uca.rs.mime.resolver.FormResolver Maven / Gradle / Ivy
package io.vertx.up.uca.rs.mime.resolver;
import io.vertx.core.file.FileSystem;
import io.vertx.ext.web.FileUpload;
import io.vertx.ext.web.RoutingContext;
import io.vertx.up.atom.Epsilon;
import io.vertx.up.uca.rs.mime.Resolver;
import io.vertx.up.unity.Ux;
import java.util.Set;
public class FormResolver implements Resolver {
@Override
public Epsilon resolve(final RoutingContext context,
final Epsilon income) {
final Set fileUploads = context.fileUploads();
/*
* Not needed to group `Set`
*/
final Class> argType = income.getArgType();
final FileSystem fileSystem = context.vertx().fileSystem();
final T result = Ux.toFile(fileUploads, argType, fileSystem::readFileBlocking);
income.setValue(result);
return income;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy