本文整理匯總了Java中io.undertow.util.Headers.extractQuotedValueFromHeader方法的典型用法代碼示例。如果您正苦於以下問題:Java Headers.extractQuotedValueFromHeader方法的具體用法?Java Headers.extractQuotedValueFromHeader怎麽用?Java Headers.extractQuotedValueFromHeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.undertow.util.Headers
的用法示例。
在下文中一共展示了Headers.extractQuotedValueFromHeader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: beginPart
import io.undertow.util.Headers; //導入方法依賴的package包/類
@Override
public void beginPart(final HeaderMap headers) {
this.currentFileSize = 0;
this.headers = headers;
final String disposition = headers.getFirst(Headers.CONTENT_DISPOSITION);
if (disposition != null) {
if (disposition.startsWith("form-data")) {
currentName = Headers.extractQuotedValueFromHeader(disposition, "name");
fileName = Headers.extractQuotedValueFromHeader(disposition, "filename");
if (fileName != null) {
try {
file = File.createTempFile("undertow", "upload", tempFileLocation);
createdFiles.add(file);
fileChannel = exchange.getConnection().getWorker().getXnio().openFile(file, FileAccess.READ_WRITE);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}
}
示例2: create
import io.undertow.util.Headers; //導入方法依賴的package包/類
@Override
public FormDataParser create(final HttpServerExchange exchange) {
String mimeType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
if (forceCreation || (mimeType != null && mimeType.startsWith(APPLICATION_X_WWW_FORM_URLENCODED))) {
String charset = defaultEncoding;
String contentType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
if (contentType != null) {
String cs = Headers.extractQuotedValueFromHeader(contentType, "charset");
if (cs != null) {
charset = cs;
}
}
return new FormEncodedDataParser(charset, exchange);
}
return null;
}
示例3: getCharacterEncoding
import io.undertow.util.Headers; //導入方法依賴的package包/類
@Override
public String getCharacterEncoding() {
if (characterEncoding != null) {
return characterEncoding.name();
}
String contentType = exchange.getRequestHeaders().getFirst(Headers.CONTENT_TYPE);
if (contentType == null) {
return null;
}
return Headers.extractQuotedValueFromHeader(contentType, "charset");
}
示例4: extractCharset
import io.undertow.util.Headers; //導入方法依賴的package包/類
private String extractCharset(HeaderMap headers) {
String contentType = headers.getFirst(Headers.CONTENT_TYPE);
if (contentType == null) {
return null;
}
String value = Headers.extractQuotedValueFromHeader(contentType, "charset");
if(value != null) {
return value;
}
return ISO_8859_1;
}