当前位置: 首页>>代码示例>>Java>>正文


Java FormParserFactory类代码示例

本文整理汇总了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);
}
 
开发者ID:taichi,项目名称:siden,代码行数:19,代码来源:DefaultAppBuilder.java

示例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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:FormAuthenticationMechanism.java

示例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();

}
 
开发者ID:aaronanderson,项目名称:swarm-oidc,代码行数:10,代码来源:OIDCAuthenticationMechanism.java

示例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));
	}

}
 
开发者ID:aaronanderson,项目名称:swarm-oidc,代码行数:17,代码来源:OIDCAuthenticationMechanism.java

示例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;
}
 
开发者ID:svenkubiak,项目名称:mangooio,代码行数:47,代码来源:FormHandler.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ExternalAuthenticationMechanism.java

示例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"));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:BasicAuthenticationMechanism.java

示例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));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ClientCertAuthenticationMechanism.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:DigestAuthenticationMechanism.java

示例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);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:ServletFormAuthenticationMechanism.java

示例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));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ServletFormAuthenticationMechanism.java

示例12: getFormParserFactory

import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public FormParserFactory getFormParserFactory() {
    return formParserFactory;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:ManagedServlet.java

示例13: create

import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
    return authenticationMechanism;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ImmediateAuthenticationMechanismFactory.java

示例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();
}
 
开发者ID:neowu,项目名称:core-ng-project,代码行数:7,代码来源:HTTPServerIOHandler.java

示例15: DomainApiUploadHandler

import io.undertow.server.handlers.form.FormParserFactory; //导入依赖的package包/类
public DomainApiUploadHandler(ModelController modelController) {
    this.modelController = modelController;
    this.formParserFactory = FormParserFactory.builder().build();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:5,代码来源:DomainApiUploadHandler.java


注:本文中的io.undertow.server.handlers.form.FormParserFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。