本文整理汇总了Java中io.undertow.server.handlers.form.FormParserFactory类的典型用法代码示例。如果您正苦于以下问题:Java FormParserFactory类的具体用法?Java FormParserFactory怎么用?Java FormParserFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FormParserFactory类属于io.undertow.server.handlers.form包,在下文中一共展示了FormParserFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeFormHandler
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
protected HttpHandler makeFormHandler(App root, OptionMap config,
HttpHandler next) {
FormParserFactory.Builder builder = FormParserFactory.builder(false);
FormEncodedDataDefinition form = new FormEncodedDataDefinition();
String cn = config.get(Config.CHARSET).name();
form.setDefaultEncoding(cn);
MultiPartParserDefinition mult = new MultiPartParserDefinition(
config.get(Config.TEMP_DIR));
mult.setDefaultEncoding(cn);
mult.setMaxIndividualFileSize(config.get(Config.MAX_FILE_SIZE));
builder.addParsers(form, mult);
EagerFormParsingHandler efp = new EagerFormParsingHandler(
builder.build());
return efp.setNext(next);
}
示例2: FormAuthenticationMechanism
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public FormAuthenticationMechanism(final FormParserFactory formParserFactory, final String name, final String loginPage, final String errorPage, final String postLocation) {
this.name = name;
this.loginPage = loginPage;
this.errorPage = errorPage;
this.postLocation = postLocation;
this.formParserFactory = formParserFactory;
}
示例3: OIDCAuthenticationMechanism
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
private OIDCAuthenticationMechanism(String mechanismName, Realm realm, String redirectPath, FormParserFactory formParserFactory, IdentityManager identityManager) {
this.mechanismName = mechanismName;
this.redirectPath = redirectPath;
this.formParserFactory = formParserFactory;
this.identityManager = identityManager;
this.oidcProvider = configure(realm.getProvider());
this.stateKey = stateKey();
}
示例4: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
// <auth-method>BASIC?silent=true,FORM</auth-method>
// "When adding the mechanism name to the LoginConfig structure it
// is also possible to specify a property map."
String realm = properties.get(REALM);
// String contextPath = properties.get(CONTEXT_PATH);
Optional<Realm> realmProviders = oidc.listRealms().stream().filter(r -> realm.equals(r.getName())).findFirst();
if (realmProviders.isPresent()) {
return new OIDCAuthenticationMechanism(mechanismName, realmProviders.get(), oidc.getContext(), formParserFactory, identityManager);
} else {
throw new RuntimeException(String.format("Unable to find realm configuration for %s", realm));
}
}
示例5: getForm
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
/**
* Retrieves the form parameter from a request
*
* @param exchange The Undertow HttpServerExchange
*
* @throws IOException
*/
@SuppressWarnings("all")
protected Form getForm(HttpServerExchange exchange) throws IOException {
final Form form = Application.getInstance(Form.class);
if (this.requestHelper.isPostPutPatch(exchange)) {
final Builder builder = FormParserFactory.builder();
builder.setDefaultCharset(Charsets.UTF_8.name());
final FormDataParser formDataParser = builder.build().createParser(exchange);
if (formDataParser != null) {
exchange.startBlocking();
final FormData formData = formDataParser.parseBlocking();
formData.forEach(data -> {
Deque<FormValue> deque = formData.get(data);
if (deque != null) {
FormValue formValue = deque.element();
if (formValue != null) {
if (formValue.isFile() && formValue.getPath() != null) {
form.addFile(formValue.getPath().toFile());
} else {
if (data.contains("[]")) {
String key = StringUtils.replace(data, "[]", "");
for (Iterator iterator = deque.iterator(); iterator.hasNext();) {
form.addValueList(new HttpString(key).toString(), ((FormValue) iterator.next()).getValue());
}
} else {
form.addValue(new HttpString(data).toString(), formValue.getValue());
}
}
}
}
});
form.setSubmitted(true);
}
}
return form;
}
示例6: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new ExternalAuthenticationMechanism(mechanismName);
}
示例7: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
String realm = properties.get(REALM);
String silent = properties.get(SILENT);
return new BasicAuthenticationMechanism(realm, mechanismName, silent != null && silent.equals("true"));
}
示例8: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
String forceRenegotiation = properties.get(FORCE_RENEGOTIATION);
return new ClientCertAuthenticationMechanism(mechanismName, forceRenegotiation == null ? true : "true".equals(forceRenegotiation));
}
示例9: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new DigestAuthenticationMechanism(properties.get(REALM), properties.get(CONTEXT_PATH), mechanismName);
}
示例10: ServletFormAuthenticationMechanism
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public ServletFormAuthenticationMechanism(FormParserFactory formParserFactory, String name, String loginPage, String errorPage, String postLocation) {
super(formParserFactory, name, loginPage, errorPage, postLocation);
}
示例11: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new ServletFormAuthenticationMechanism(formParserFactory, mechanismName, properties.get(LOGIN_PAGE), properties.get(ERROR_PAGE));
}
示例12: getFormParserFactory
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public FormParserFactory getFormParserFactory() {
return formParserFactory;
}
示例13: create
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return authenticationMechanism;
}
示例14: HTTPServerIOHandler
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
HTTPServerIOHandler(HTTPServerHandler handler) {
this.handler = handler;
FormParserFactory.Builder builder = FormParserFactory.builder();
builder.setDefaultCharset(Charsets.UTF_8.name());
formParserFactory = builder.build();
}
示例15: DomainApiUploadHandler
import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public DomainApiUploadHandler(ModelController modelController) {
this.modelController = modelController;
this.formParserFactory = FormParserFactory.builder().build();
}