public class HeaderUtil extends Object
Constructor and Description |
---|
HeaderUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
appendHeaderParams(StringBuilder headerValue,
BMap map)
Get the header value intact with parameters.
|
static BString |
extractBoundaryParameter(String contentType)
Given a Content-Type, extract the boundary parameter value out of it.
|
static String |
getBaseType(BStruct entityStruct) |
static String |
getHeaderValue(BStruct bodyPart,
String headerName)
Extract the header value from a body part for a given header name.
|
static String |
getHeaderValue(String headerValue)
Get header value without parameters.
|
static BMap<String,BValue> |
getParamMap(String headerValue)
Given a header value, get it's parameters.
|
static boolean |
isMultipart(String contentType) |
static void |
setHeaderToEntity(BStruct entity,
String key,
String value) |
public static BMap<String,BValue> getParamMap(String headerValue)
headerValue
- Header value as a stringpublic static String getHeaderValue(String headerValue)
headerValue
- Header value with parameters as a stringpublic static String getHeaderValue(BStruct bodyPart, String headerName)
bodyPart
- Represent a ballerina body partheaderName
- Represent an http header namepublic static String appendHeaderParams(StringBuilder headerValue, BMap map)
headerValue
- Header value as a stringmap
- Represent a parameter mappublic static boolean isMultipart(String contentType)
public static BString extractBoundaryParameter(String contentType)
contentType
- Represent the value of Content-Type header including parameterspublic static String getBaseType(BStruct entityStruct) throws MimeTypeParseException
MimeTypeParseException
Copyright © 2018 WSO2. All rights reserved.