use of org.apache.http.message.BasicHeaderElement in project robovm by robovm.
the class NetscapeDraftHeaderParser method parseHeader.
public HeaderElement parseHeader(final CharArrayBuffer buffer, final ParserCursor cursor) throws ParseException {
if (buffer == null) {
throw new IllegalArgumentException("Char array buffer may not be null");
}
if (cursor == null) {
throw new IllegalArgumentException("Parser cursor may not be null");
}
NameValuePair nvp = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
List<NameValuePair> params = new ArrayList<NameValuePair>();
while (!cursor.atEnd()) {
NameValuePair param = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
params.add(param);
}
return new BasicHeaderElement(nvp.getName(), nvp.getValue(), params.toArray(new NameValuePair[params.size()]));
}
use of org.apache.http.message.BasicHeaderElement in project coprhd-controller by CoprHD.
the class NTLMDecryptedEntity method buildContentTypeHeader.
/**
* Builds the content type header that would have existed in a decrypted message.
*
* @param type
* the original content type
* @param encoding
* the original charset
*
* @return the new content type header
*/
private Header buildContentTypeHeader(String type, String encoding) {
NameValuePair[] nvps = new NameValuePair[] { new BasicNameValuePair(NTLMConstants.CHARSET, encoding) };
BasicHeaderElement elem = new BasicHeaderElement(type, null, nvps);
return new BasicHeader(HttpHeaders.CONTENT_TYPE, BasicHeaderValueFormatter.formatHeaderElement(elem, false, null));
}
use of org.apache.http.message.BasicHeaderElement in project platform_external_apache-http by android.
the class NetscapeDraftHeaderParser method parseHeader.
public HeaderElement parseHeader(final CharArrayBuffer buffer, final ParserCursor cursor) throws ParseException {
if (buffer == null) {
throw new IllegalArgumentException("Char array buffer may not be null");
}
if (cursor == null) {
throw new IllegalArgumentException("Parser cursor may not be null");
}
NameValuePair nvp = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
List<NameValuePair> params = new ArrayList<NameValuePair>();
while (!cursor.atEnd()) {
NameValuePair param = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
params.add(param);
}
return new BasicHeaderElement(nvp.getName(), nvp.getValue(), params.toArray(new NameValuePair[params.size()]));
}
use of org.apache.http.message.BasicHeaderElement in project XobotOS by xamarin.
the class NetscapeDraftHeaderParser method parseHeader.
public HeaderElement parseHeader(final CharArrayBuffer buffer, final ParserCursor cursor) throws ParseException {
if (buffer == null) {
throw new IllegalArgumentException("Char array buffer may not be null");
}
if (cursor == null) {
throw new IllegalArgumentException("Parser cursor may not be null");
}
NameValuePair nvp = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
List<NameValuePair> params = new ArrayList<NameValuePair>();
while (!cursor.atEnd()) {
NameValuePair param = this.nvpParser.parseNameValuePair(buffer, cursor, DELIMITERS);
params.add(param);
}
return new BasicHeaderElement(nvp.getName(), nvp.getValue(), params.toArray(new NameValuePair[params.size()]));
}
use of org.apache.http.message.BasicHeaderElement in project coprhd-controller by CoprHD.
the class EncryptingState method buildContentTypeHeader.
/**
* Builds the new content type header. This is as per NTLM specification.
*
* @return the new content type header
*/
private Header buildContentTypeHeader() {
NameValuePair[] nvps = new NameValuePair[] { new BasicNameValuePair(NTLMConstants.PROTOCOL, NTLMConstants.CONTENT_TYPE_FOR_SPNEGO), new BasicNameValuePair(NTLMConstants.BOUNDARY, BOUNDARY) };
BasicHeaderElement elem = new BasicHeaderElement(NTLMConstants.CONTENT_TYPE_FOR_MULTIPART_ENCRYPTED, null, nvps);
return new BasicHeader(HttpHeaders.CONTENT_TYPE, BasicHeaderValueFormatter.formatHeaderElement(elem, false, null));
}
Aggregations