Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
HttpComponents Client Source Code Files
HttpComponents Client Source Code Files are provided in the source package file, httpcomponents-client-5.2-src.zip.
You can download httpcomponents-client-5.2-src.zip as described in the previous tutorial and go to the "httpclient5/src" sub-folder to view Source Code files.
You can also browse HttpComponents Client Source Code below:
✍: FYIcenter.com
⏎ org/apache/hc/client5/http/ssl/DistinguishedNameParser.java
/* * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.hc.client5.http.ssl; import java.util.ArrayList; import java.util.BitSet; import java.util.List; import org.apache.hc.core5.http.NameValuePair; import org.apache.hc.core5.http.message.BasicNameValuePair; import org.apache.hc.core5.util.CharArrayBuffer; import org.apache.hc.core5.util.Tokenizer; final class DistinguishedNameParser { public final static DistinguishedNameParser INSTANCE = new DistinguishedNameParser(); private static final BitSet EQUAL_OR_COMMA_OR_PLUS = Tokenizer.INIT_BITSET('=', ',', '+'); private static final BitSet COMMA_OR_PLUS = Tokenizer.INIT_BITSET(',', '+'); private final Tokenizer tokenParser; DistinguishedNameParser() { this.tokenParser = new InternalTokenParser(); } private String parseToken(final CharArrayBuffer buf, final Tokenizer.Cursor cursor, final BitSet delimiters) { return tokenParser.parseToken(buf, cursor, delimiters); } private String parseValue(final CharArrayBuffer buf, final Tokenizer.Cursor cursor, final BitSet delimiters) { return tokenParser.parseValue(buf, cursor, delimiters); } private NameValuePair parseParameter(final CharArrayBuffer buf, final Tokenizer.Cursor cursor) { final String name = parseToken(buf, cursor, EQUAL_OR_COMMA_OR_PLUS); if (cursor.atEnd()) { return new BasicNameValuePair(name, null); } final int delim = buf.charAt(cursor.getPos()); cursor.updatePos(cursor.getPos() + 1); if (delim == ',') { return new BasicNameValuePair(name, null); } final String value = parseValue(buf, cursor, COMMA_OR_PLUS); if (!cursor.atEnd()) { cursor.updatePos(cursor.getPos() + 1); } return new BasicNameValuePair(name, value); } List<NameValuePair> parse(final CharArrayBuffer buf, final Tokenizer.Cursor cursor) { final List<NameValuePair> params = new ArrayList<>(); tokenParser.skipWhiteSpace(buf, cursor); while (!cursor.atEnd()) { final NameValuePair param = parseParameter(buf, cursor); params.add(param); } return params; } List<NameValuePair> parse(final String s) { if (s == null) { return null; } final CharArrayBuffer buffer = new CharArrayBuffer(s.length()); buffer.append(s); final Tokenizer.Cursor cursor = new Tokenizer.Cursor(0, s.length()); return parse(buffer, cursor); } static class InternalTokenParser extends Tokenizer { @Override public void copyUnquotedContent( final CharSequence buf, final Tokenizer.Cursor cursor, final BitSet delimiters, final StringBuilder dst) { int pos = cursor.getPos(); final int indexFrom = cursor.getPos(); final int indexTo = cursor.getUpperBound(); boolean escaped = false; for (int i = indexFrom; i < indexTo; i++, pos++) { final char current = buf.charAt(i); if (escaped) { dst.append(current); escaped = false; } else { if ((delimiters != null && delimiters.get(current)) || Tokenizer.isWhitespace(current) || current == '\"') { break; } else if (current == '\\') { escaped = true; } else { dst.append(current); } } } cursor.updatePos(pos); } } }
⏎ org/apache/hc/client5/http/ssl/DistinguishedNameParser.java
Or download all them as a single archive file:
File name: httpclient5-5.2-fyi.zip File size: 625318 bytes Release date: 2022-11-10 Download
⇒ Download and Install HttpComponents Core Binary Package
⇐ Download and Install HttpComponents Client Source Package
2023-03-26, 23332👍, 1💬
Popular Posts:
What is jxl.jar 2.6.12? jxl.jar 2.6.12 is the JAR file for Java Excel API 2.6.12, which is a Java li...
How to download and install ojdbc14.jar for Oracle 10g R2? ojdbc14.jar for Oracle 10g R2 is a Java 1...
Where to find answers to frequently asked questions on Downloading and Installing Connector/J - JDBC...
This package is the backport of java.util.concurrent API, introduced in Java 5.0 and further refined...
How to download and install xml-commons External Source Package? The source package contains Java so...