httpcomponents-core-4.4.4/ 0040755 0000000 0000000 00000000000 12613460515 014273 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/LICENSE.txt 0100644 0000000 0000000 00000052462 12613456012 016121 0 ustar 00 0000000 0000000
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
=========================================================================
This project contains annotations in the package org.apache.http.annotation
which are derived from JCIP-ANNOTATIONS
Copyright (c) 2005 Brian Goetz and Tim Peierls.
See http://www.jcip.net and the Creative Commons Attribution License
(http://creativecommons.org/licenses/by/2.5)
Full text: http://creativecommons.org/licenses/by/2.5/legalcode
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
"Licensor" means the individual or entity that offers the Work under the terms of this License.
"Original Author" means the individual or entity who created the Work.
"Work" means the copyrightable work of authorship offered under the terms of this License.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
to create and reproduce Derivative Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
For the avoidance of doubt, where the work is a musical composition:
Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested.
If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
httpcomponents-core-4.4.4/README.txt 0100644 0000000 0000000 00000004145 12613456023 015771 0 ustar 00 0000000 0000000 Apache HttpComponents Core
==========================
Welcome to the HttpCore component of the Apache HttpComponents project.
Building Instructions
---------------------
For building from source instructions please refer to BUILDING.txt.
Dependencies
------------
HttpCore requires Java 1.6 compatible runtime.
Licensing
---------
Apache HttpComponents Core is licensed under the Apache License 2.0.
See the files called LICENSE.txt and NOTICE.txt for more information.
Cryptographic Software Notice
-----------------------------
This distribution may include software that has been designed for use
with cryptographic software. The country in which you currently reside
may have restrictions on the import, possession, use, and/or re-export
to another country, of encryption software. BEFORE using any encryption
software, please check your country's laws, regulations and policies
concerning the import, possession, or use, and re-export of encryption
software, to see if this is permitted. See
for more information.
The U.S. Government Department of Commerce, Bureau of Industry and
Security (BIS), has classified this software as Export Commodity
Control Number (ECCN) 5D002.C.1, which includes information security
software using or performing cryptographic functions with asymmetric
algorithms. The form and manner of this Apache Software Foundation
distribution makes it eligible for export under the License Exception
ENC Technology Software Unrestricted (TSU) exception (see the BIS
Export Administration Regulations, Section 740.13) for both object
code and source code.
The following provides more details on the included software that
may be subject to export controls on cryptographic software:
Apache HttpComponents Core interfaces with the
Java Secure Socket Extension (JSSE) API to provide
- HTTPS support
Apache HttpComponents Core does not include any
implementation of JSSE.
Contact
-------
o For general information visit the main project site at
http://hc.apache.org/
o For current status information visit the status page at
http://hc.apache.org/status.html
httpcomponents-core-4.4.4/BUILDING.txt 0100644 0000000 0000000 00000002453 12613456023 016231 0 ustar 00 0000000 0000000 Building HttpComponents Core
============================
(1) Requisites
--------------
JDK 1.6+ is required in order to compile and run HttpCore.
HttpCore utilizes Maven as a distribution management and packaging tool.
Version 3.0.3 or later is required.
Maven installation and configuration instructions can be found here:
http://maven.apache.org/run-maven/index.html
(2) Executing test cases
Execute the following command in order to compile and test the components
mvn test
(3) Building packages
Execute the following command in order to build the JAR packages and install
them to the local repository:
mvn install
The JAR packages can be found in the target folders of their respective modules
httpcore/target/httpcore-.jar
httpcore-nio/target/httpcore-nio-.jar
httpcore-osgi/target/org.apache.httpcomponents.httpcore_.jar
where is the release version
(4) Validating packages
Check for binary compatibility with the previous version with:
mvn clirr:check
Check for proper license headers with:
mvn apache-rat:check
(5) Building documentation
Execute the following command in order to generate javadoc:
mvn javadoc:aggregate
Execute the following command in order to generate the tutorial in html and pdf formats
mvn docbkx:generate-pdf docbkx:generate-html
httpcomponents-core-4.4.4/NOTICE.txt 0100644 0000000 0000000 00000000475 12613456011 016014 0 ustar 00 0000000 0000000 Apache HttpComponents Core
Copyright 2005-2015 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
This project contains annotations derived from JCIP-ANNOTATIONS
Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
httpcomponents-core-4.4.4/RELEASE_NOTES.txt 0100644 0000000 0000000 00000166240 12613456012 017067 0 ustar 00 0000000 0000000 Release 4.4.4
-------------------
This is a maintenance release that fixes a number of issues discovered since 4.4.3.
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Changelog
-------------------
* [HTTPCORE-410] PoolStats made Serializable
Contributed by Oleg Kalnichevski
* BufferedHttpEntity to use HttpEntity#writeTo when buffering non-repeatable entities
Contributed by Oleg Kalnichevski
* Fixed race condition in request initialization code in async client protocol handlers
Contributed by Oleg Kalnichevski
* Fixed handling of pipelined HEAD requests
Contributed by Oleg Kalnichevski
* [HTTPCORE-409] NIO HttpServer does not shutdown listener ExecutorService
Contributed by Hiranya Jayathilaka
Release 4.4.3
-------------------
This is a maintenance release that fixes a regression introduced by release 4.4.2.
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Changelog
-------------------
* Fixed regression introduced by HTTPCORE-399.
Contributed by Oleg Kalnichevski
Release 4.4.2
-------------------
This maintenance release fixes a bug in HTTP request pipelining code discovered
after 4.4.1 release.
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Changelog
-------------------
* Throw ConnectionClosedException instead of IllegalStateException if an attempt is made to
use a closed (not bound to a socket) blocking connection.
Contributed by Oleg Kalnichevski
* [HTTPCORE-399] Non-blocking client connections incorrectly suspend output causing
sequential execution of requests.
Contributed by Oleg Kalnichevski
Release 4.4.1
-------------------
This maintenance release fixes a number of minor bugs found since 4.4.
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Changelog
-------------------
* [HTTPCORE-396]: PrivateKeyStrategy does not work with NIO SSL.
Contributed by Oleg Kalnichevski
* [HTTPCORE-395]: VersionInfo#getUserAgent reports incorrect Java version.
Contributed by Michael Osipov
* Non-blocking connection should not trigger end-of-stream callback as long as there is still
data in the session input buffer. This can cause a series of short pipelined requests to
fail prematurely in case of an unexpected connection termination by the opposite endpoint.
Contributed by Oleg Kalnichevski
Release 4.4
-----------------
This is the first stable (GA) release of HttpCore 4.4. Notable features included in
the 4.4 series are:
* Support for pipelined request processing on the server side
* Support for pipelined request execution on the client side
* Simplified bootstrapping of blocking and non-blocking (NIO) HTTP server implementations
* Inclusion of SSL context initialization utilities from HttpClient
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Changelog
-------------------
* Performance optimizations
Contributed by Dmitry Potapov
* Update Apache Commons Logging version from 1.1.3 to 1.2.
Contributed by Gary Gregory
Release 4.4-BETA1
-------------------
This is the first BETA release from 4.4 release series. Notable features included in
the 4.4 series are:
* Support for pipelined request processing on the server side
* Support for pipelined request execution on the client side
* Simplified bootstrapping of blocking and non-blocking (NIO) HTTP server implementations
* Inclusion of SSL context initialization utilities from HttpClient
* New HTTP element tokenizer implementation
Please note that as of 4.4 HttpCore requires Java 1.6 or newer.
Release 4.4-ALPHA1
-------------------
This is the first release from the 4.4.x development branch. The most notable features included in
this release are:
* Support for pipelined request processing on the server side
* Support for pipelined request execution on the client side
* Simplified bootstrapping of blocking and non-blocking (NIO) HTTP server implementations
This release also includes all fixes from the stable 4.2.x release branch.
Changelog
-------------------
* [HTTPASYNC-77] system resources are not correctly deallocated if I/O reactor is shut down
while still inactive (not started)
Contributed by Oleg Kalnichevski
* [HTTPCORE-377] Allow zero SO_LINGER (immediate abortive close).
Contributed by Dmitry Potapov
* [HTTPCORE-376] AbstractNIOConnPool#requestCancelled() should not process pending requests
wnen being shut down.
Contributed by Dmitry Potapov
* [HTTPASYNC-69]: async request handler is closed by HttpAsyncRequestExecutor#closed
if the underlying connection is found to be in an inconsistent state.
Contributed by Oleg Kalnichevski
* [HTTPCORE-372] Blocking and non-blocking chunk decoders to throw an I/O exception if data stream
is terminated without a closing chunk.
Contributed by Dmitry Potapov
* [HTTPCORE-368] Customizable buffer management strategies for SSLIOSession.
Contributed by offbynull
* [HTTPCORE-358] Added I/O reactor listener backlog parameter.
Contributed by Dmitry Potapov
* [HTTPCORE-357] Avoid DNS lookups in SSLIOSession.
Contributed by Oleg Kalnichevski
* Update JUnit to version 4.11 from 4.9
Contributed by Gary Gregory
Release 4.3.2
-------------------
This maintenance release fixes a number of bugs and regressions found since 4.3.1, mostly in the
NIO transport components. All users of HttpCore 4.3 are advised to upgrade.
Changelog
-------------------
* [HTTPCORE-371] Support for SSL re-negotiation with NIO.
Contributed by Asankha Perera
* [HTTPCORE-373] Out of sequence HTTP response causes NPE in HttpAsyncRequestExecutor.
Contributed by Oleg Kalnichevski
* [HTTPCORE-370] Race condition if connection request succeeds and times out at the same time.
Contributed by Oleg Kalnichevski
* (Regression) Fixed synchronization issue in blocking and non-blocking connection pool
implementations caused by HTTPCORE-362
Contributed by Oleg Kalnichevski
Release 4.3.1
-------------------
This maintenance release fixes a number of bugs and regressions found since 4.3, mostly in the
NIO transport components. All users of HttpCore 4.3 are advised to upgrade.
Changelog
-------------------
* [HTTPCORE-367] (Regression) Non-blocking connections can enter a tight loop while waiting
for a chunk header split across multiple TCP frames.
Contributed by Oleg Kalnichevski
* [HTTPCORE-366] Non-blocking SSLIOSession can enter an infinite loop if the underlying
channel receives incoming data simultaneously with inactivity timeout.
Contributed by Oleg Kalnichevski
* [HTTPCORE-364] IOSessionImpl.getLocalAddress() (etc.) creates unnecessary copy of channel
* DefaultConnectingIOReactor / DefaultListeningIOReactor do not correctly apply some initial
socket settings.
Contributed by Andreas Veithen
* [HTTPCORE-357] Avoid DNS lookups in SSLIOSessions in server mode.
Contributed by Isaac Cruz Ballesteros
* [HTTPCORE-362] Purge pool per route map after closing out expired or idle connections with
#closeExpired and #closeIdle methods.
Contributed by Oleg Kalnichevski
* [HTTPCORE-361] Reduced intermediate garbage in HeaderGroup#getFirstHeader()
Contributed by Oleg Kalnichevski
* [HTTPCORE-355] HttpAsyncRequestExecutor fails when its handler is not ready to generate
a request.
Contributed by jd
* [HTTPCORE-354] BasicConnFactory don't use SocketConfig#isSoKeepAlive.
Contributed by David Ignjic
* [HTTPCORE-347] (Regression) HttpResponse#setStatusCode() does not update reason phrase.
Contributed by Oleg Kalnichevski
Release 4.3
-------------------
This is the first stable (GA) release of HttpCore 4.3. The most notable features in the 4.3
branch are:
* Deprecation of preference and configuration API based on HttpParams interface in favor of
constructor injection and plain configuration objects.
* Reliance on object immutability instead of access synchronization for thread safety.
Several old classes whose instances can be shared by multiple request exchanges have
been replaced by immutable equivalents.
The 4.3 branch also contains performance optimizations such as reduced TCP packet fragmentation
and more efficient lease / release operations for pools of persistent connections on the client
side.
This release also includes all fixes from the 4.2.x release branch.
Users of HttpCore 4.2 are encouraged to upgrade.
Changelog
-------------------
* [HTTPCORE-343] AbstractNIOConnPool to fire request callbacks outside the pool lock.
This makes it possible to re-enter pool methods from a callback event.
Contributed by Oleg Kalnichevski
* [HTTPCORE-340] AbstractNIOConnPool to support lease timeout distinct from connect timeout.
Contributed by Ignat Alexeyenko
* Blocking connections do not clean session input buffer when closed (input data from a read
operation may still remain in the buffer if the connection is re-opened).
Contributed by Oleg Kalnichevski
Release 4.2.5
-------------------
This maintenance release fixes a number of bugs found in NIO components since 4.2.4. We advise
users of HttpCore NIO of all versions to upgrade.
This is likely to be the last release in the 4.2.x branch.
Changelog
-------------------
* [HTTPCORE-345] EntityAsyncContentProducer fails to release resources allocated by the underlying
entity when #produceContent is never invoked.
Contributed by Tad Whitenight
* Non-blocking connection pool to avoid scanning the entire queue of pending connection requests
on each connection lease / release operation (under heavy load the request queue can contain
a significant number of pending requests, a full linear scan of which can cause massive
performance degradation).
Contributed by Oleg Kalnichevski
* Use bulk ByteBuffer#put method instead of single byte ByteBuffer#put
Contributed by Oleg Kalnichevski
* [HTTPCORE-336] Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor.
Contributed by Thomas Dudek
Release 4.3-BETA2
-------------------
This is the second BETA release from the 4.3.x release branch. This release addresses performance
issues in the non-blocking connection pool implementation and also includes a number of performance
improvements in the low level NIO based transport components.
Changelog
-------------------
* [HTTPCORE-300] ContentType to provide support for custom parameters.
Contributed by Oleg Kalnichevski
* Non-blocking connection pool to avoid scanning the entire queue of pending connection requests
on each connection lease / release operation (under heavy load the request queue can contain
a significant number of pending requests, a full linear scan of which can cause massive
performance degradation).
Contributed by Oleg Kalnichevski
* Basic connection pool implementations to perform default port resolution for HTTP and HTTPS
schemes.
Contributed by Oleg Kalnichevski
* Use bulk ByteBuffer#put method instead of single byte ByteBuffer#put
Contributed by Oleg Kalnichevski
* [HTTPCORE-336] Unhandled CancelledKeyException leads to a shutdown of the underlying IOReactor.
Contributed by Thomas Dudek
Release 4.3-BETA1
-------------------
This is the first BETA release from the 4.3.x release branch. The main theme of the 4.3 release
series is streamlining of component configuration and deprecation of the old configuration
API based on HttpParams in favor of constructor-based dependency injection and plain objects
for configuration parameters.
This release also includes performance optimizations intended to reduce TCP packet fragmentation
when writing out HTTP messages both in blocking and non-blocking I/O modes, which should result
in up to 20% higher throughput for short entity enclosing messages.
This release also includes all fixes from the stable 4.2.x release branch.
Changelog
-------------------
* Reduced TCP packet fragmentation when writing out message content with blocking and
non-blocking connections.
Contributed by Oleg Kalnichevski
* [HTTPCORE-330] Clarify InputStreamEntity length constructor argument.
Contributed by John McCarthy
* [HTTPCORE-323] Undocumented UnsupportedCharsetException in ContentType#getOrDefault.
Contributed by Gary D. Gregory
Release 4.2.4
-------------------
This maintenance release fixes a number of bugs found in NIO components since 4.2.3. We advise
users of HttpCore NIO of all versions to upgrade.
Changelog
-------------------
* [HTTPCORE-334] https request to a non-responsive but alive port over a non-blocking connection
results in a busy loop in one of I/O dispatch threads.
Contributed by Scott Stanton
* [HTTPCORE-331] BasicFuture no longer executes notification callbacks inside a synchronized block.
Contributed by Oleg Kalnichevski
* [HTTPCORE-319] Non-blocking SSLIOSession can fail to shut down correctly when the underlying
connection gets terminated abnormally by the opposite endpoint in case there is a truncated or
corrupted encrypted content in the input buffer and there is still data in the output buffer
that needs to be flushed out (most likely to occur with POST or PUT requests).
Contributed by Oleg Kalnichevski
Release 4.3-ALPHA1
-------------------
This is the first release from the 4.3.x release branch. The main focus of the 4.3 release
series is streamlining of component configuration and deprecation of the old configuration
API based on HttpParams in favor of constructor based dependency injection and plain objects
for configuration parameters.
We are kindly asking all upstream projects to review API changes and help us improve
the APIs by providing feedback and sharing ideas on dev@hc.apache.org.
This release also includes all fixes from the stable 4.2.x release branch.
Release 4.2.3
-------------------
This maintenance release fixes a number of bugs and found since 4.2.2 including
a major bug in the NIO module that can cause an infinite loop in SSL sessions under special
circumstances when the remote peer terminates the session in the middle of SSL handshake.
Please note this issue does not affect blocking I/O components used by HttpClient.
We advise users of HttpCore NIO of all versions to upgrade.
Changelog
-------------------
* [HTTPCORE-319, HTTPCORE-322] Non-blocking SSLIOSession can enter an infinite loop under
special circumstances when the remote peer terminates the session in the middle of SSL handshake.
Contributed by Paul Donohue and
Oleg Kalnichevski
* [HTTPCORE-316] HeaderGroup#clone removes headers from the original object.
Contributed by Markus Thies
* [HTTPCORE-315] AbstractNIOConnPool fails to correctly deallocate connection if it is immediately
released from the session request callback causing a resource leak.
Contributed by Scott Stanton
* [HTTPCORE-313] ContentType#parse now ignores empty and blank charset attributes.
HttpEntityUtils#toString now throws checked I/O exception if it encounters an unsupported
charset.
Contributed by Oleg Kalnichevski
Release 4.2.2
-------------------
This is a maintenance release that fixes a number of bugs and regressions found since 4.2.1
including a major bug in the NIO module causing incorrect handling of outgoing Content-Length
delimited messages larger than 2GB.
Users of HttpCore 4.2 are advised to upgrade.
Changelog
-------------------
* [HTTPCORE-312] NIO length delimited content encoder incorrectly handles messages larger than 2GB.
Contributed by Oleg Kalnichevski
* [HTTPCORE-310] Fixed regression in DefaultConnectionReuseStrategy causing it to incorrectly
flag connections as non-reusable after a 204, 205 or 304 response.
Contributed by Oleg Kalnichevski
* [HTTPCORE-309] Fixed regression in HttpAsyncRequestExecutor causing it to handle 204, 205
and 304 responses incorrectly by returning a message with an enclosed content body.
Contributed by Oleg Kalnichevski
* [HTTPCORE-306] I/O reactor TCP_NODELAY parameter now defaults to true.
Contributed by Oleg Kalnichevski
* [HTTPASYNC-21] request execution handler does not get closed in case of a premature HTTP
exchange termination.
Contributed by Oleg Kalnichevski
* [HTTPCORE-303] ContentType made Serializable.
Contributed by Oleg Kalnichevski
Release 4.2.1
-------------------
This is a maintenance release that fixes a non-critical number of bugs found since 4.2.
Users of HttpCore 4.2 are encouraged to upgrade.
Changelog
-------------------
* [HTTPCORE-299] ContentType should rely on Charset#name() instead of Charset#toString()
for building header value.
Contributed by Oleg Kalnichevski
* [HTTPCORE-263] Under rare circumstances incorrectly delineated or garbled HTTP message
can cause an IndexOutOfBoundsException in AbstractSessionInputBuffer#readLine()
Contributed by Michael Pujos
* Made connection pools use FIFO algorithm instead of LIFO when leasing / releasing persistent
connections.
Contributed by Oleg Kalnichevski
* [HTTPCORE-298] Fixed non-blocking SSLIOSession state can getting out of sync with the underlying
IOSession in case the I/O session is terminated by the I/O reactor rather than by the protocol
handler.
Contributed by Sandeep Tamhankar
* Fixed NPE in StringEntity constructor thrown if ContentType#getCharset is null.
Contributed by Oleg Kalnichevski
Release 4.2
-------------------
This is the first stable (GA) release of HttpCore 4.2. The most notable features included in this
release are connection pool components for blocking and non-blocking HTTP connections and new
asynchronous client and server side protocol handlers.
New protocol handling API used in conjunction with connection pooling components is expected to
make development of asynchronous HTTP client agents and HTTP proxies easier and less error prone.
Connection pool components are based on mature code migrated from HttpClient and HttpAsyncClient
modules but have a slightly different API that makes a better use of Java standard concurrent
primitives.
Changelog
-------------------
* Fixed HttpAsyncRequestExecutor incorrect execution of message exchanges that span across multiple
hosts (for instance, in case of a request redirect).
Contributed by Oleg Kalnichevski
* AbstractHttpClientConnection#isResponseAvailable method now catches SocketTimeoutException
and returns false.
Contributed by Oleg Kalnichevski
* [HTTPCORE-296] Server side connections (both blocking and non-blocking) can now handle entity
enclosing requests without Content-Length and Transfer-Encoding headers.
Contributed by Oleg Kalnichevski
* [HTTPCORE-295] [HTTPCORE-288] Provided direct access to the underlying socket of non-blocking
HTTP connection to allow modification of socket level settings such as TCP_NODELAY, SO_KEEPALIVE,
TrafficClass, etc.
Contributed by Oleg Kalnichevski
* [HTTPCORE-289] HttpAsyncService fails to invoke Cancellable#cancel() when the ongoing HTTP
exchange is aborted by the client.
Contributed by Oleg Kalnichevski
Incompatible changes
--------------------
[Compared to release version 4.1.4]
The following methods have been deprecated for some time now and have been deleted:
org.apache.http.impl.SocketHttpServerConnection#createHttpDataReceiver(Socket, int, HttpParams)
org.apache.http.impl.SocketHttpServerConnection#createHttpDataTransmitter(Socket, int, HttpParams)
org.apache.http.protocol.HttpRequestHandlerRegistry#matchUriRequestPattern(String, String)
The following classes have been deprecated for some while now and have been deleted:
org.apache.http.nio.entity.ByteArrayNIOEntity
org.apache.http.nio.entity.FileNIOEntity
org.apache.http.nio.entity.HttpNIOEntity
org.apache.http.nio.entity.StringNIOEntity
org.apache.http.nio.protocol.NHttpClientHandlerBase
org.apache.http.nio.protocol.NHttpServiceHandlerBase
Release 4.2-BETA1
-------------------
This is the first BETA release of HttpCore 4.2. This release comes with completely redesigned
and rewritten asynchronous protocol handlers. New protocol handling API used in conjunction with
connection pooling components is expected to make development of asynchronous HTTP client agents
and HTTP proxies easier and less error prone.
Sample application shipped with the release include an example of an HTTP file server capable of
direct channel (zero copy) data transfer and an example of a non-blocking, fully streaming reverse
proxy.
This release also incorporates bug fixes from the stable 4.1.x branch and includes an updated
HttpCore tutorial.
Release 4.1.4
-------------------
This is a maintenance release that fixes a number of bugs found since 4.1.3. It is also likely
to be the last release in the 4.1.x branch.
Changelog
-------------------
* [HTTPCORE-286] Canceled I/O session can cause an IllegalStateException in BaseIOReactor#validate
leading to an abnormal termination of the I/O reactor.
Contributed by Oleg Kalnichevski
* [HTTPCORE-257] Fixed incorrect results produced by DefaultConnectionReuseStrategy when handling
response messages whose content entity has been decoded or modified by a protocol interceptor.
Contributed by Oleg Kalnichevski
* [HTTPCORE-283] Workaround for a bug causing termination of the I/O reactor in case of exception
thrown by NHttpServiceHandler#requestReceived or NHttpClientHandler#responseReceived
methods. A more comprehensive fix for the bug applied to the 4.2 branch.
Contributed by Oleg Kalnichevski
* [HTTPCORE-281] ResponseConnControl protocol interceptor does not correctly populate connection
persistence control headers when sending a HTTP/1.1 response message in response to a HTTP/1.0
request message.
Contributed by William R. Speirs
* [HTTPCORE-282] The default value of the internal event mask of newly created non-blocking I/O
is not correctly initialized, which causes the READ interest bit to get cleared in the interest
op queuing mode unless the event mask is explicitly reset.
Contributed by Sadeep Jayasumana and Oleg Kalnichevski
* [HTTPCORE-268] Handle runtime exceptions thrown by SSLEngine.
Contributed by Oleg Kalnichevski
Release 4.2-ALPHA2
-------------------
This is the second ALPHA release of HttpCore 4.2. This release comes with completely redesigned
and rewritten asynchronous protocol handlers. New protocol handling API used in conjunction with
connection pooling components introduced in the previous ALPHA release is expected to make
development of asynchronous HTTP client agents and HTTP proxies easier and less error prone.
Sample application shipped with the release include an example of an HTTP file server capable of
direct channel (zero copy) data transfer and an example of a non-blocking, fully streaming reverse
proxy.
We are kindly asking existing and prospective users of HttpCore to review and try out the
new protocol handlers and give us feedback while the 4.2 API is still not final. If no major flaws
are discovered the 4.2 API is expected to be frozen with the next BETA release.
Please note that new features included in this release are still considered experimental and
their API may change in the future ALPHA releases. This release also marks the end of support for
Java 1.3. As of this release HttpCore requires Java 1.5 for all its components. Several classes and
methods deprecated between versions 4.0-beta1 and 4.0 GA (more than two years ago) have been
removed in this release.
Changelog
-------------------
* [HTTPCORE-270] Fixed IllegalStateException in AbstractSessionOutputBuffer and
AbstractSessionInputBuffer.
Contributed by William R. Speirs
* [HTTPCORE-269] Connection pools incorrectly handle lease requests when the max limit for the given
route has been exceeded and all connections in the route pool are stateful.
Contributed by Oleg Kalnichevski
Release 4.2-ALPHA1
-------------------
This is the first ALPHA release of 4.2. The most notable feature included in this release is
support for connection pools of blocking and non-blocking HTTP connections. Connection pool
components are based on mature code migrated from HttpClient and HttpAsyncClient modules but have
a slightly different API that makes a better use of Java standard concurrent primitives.
Support for connection pools in HttpCore is expected to make development of client and proxy HTTP
services easier and less error prone.
Please note that new features included in this release are still considered experimental and
their API may change in the future ALPHA releases. This release also marks the end of support for
Java 1.3. As of this release HttpCore requires Java 1.5 for all its components. Several classes and
methods deprecated between versions 4.0-beta1 and 4.0 GA (more than two years ago) have been
removed in this release.
Changelog
-------------------
* [HTTPCORE-268] Handle runtime exceptions thrown by SSLEngine.
Contributed by Oleg Kalnichevski
Release 4.1.3
-------------------
This is an emergency release that fixes a severe regression in the non-blocking SSL I/O code
introduced in release 4.1.2.
* [HTTPCORE-266] SSLIOSession does not correctly terminate if the opposite end shuts down connection
without sending a 'close notify' message causing an infinite loop in the I/O dispatch thread.
Contributed by Oleg Kalnichevski
Release 4.1.2
-------------------
This is a patch release that fixes a number of bugs found in the previous version.
Please note that several classes and methods deprecated between versions 4.0-beta1 and 4.0 GA
(more than two years ago) will also be removed in the 4.2 branch.
Users of 4.0.x versions are advised to upgrade and replace deprecated API calls following
recommendations in javadocs.
* [HTTPCORE-261] IOSession#setSocketTimeout() method does not reset the timeout count.
Contributed by Oleg Kalnichevski
* [HTTPCORE-260] Non-blocking SSL I/O session can terminate prematurely causing message body
truncation when message content is chunk coded and the connection is closed on the opposite end.
Contributed by Oleg Kalnichevski
* [HTTPCORE-257] Fixed incorrect results produced by DefaultConnectionReuseStrategy when handling
response messages whose content entity has been decoded or modified by a protocol interceptor.
Contributed by Oleg Kalnichevski
Release 4.1.1
-------------------
This is a patch release that fixes a number of non-critical issues found since release 4.1.
This release marks the end of support for Java 1.3. As of release 4.2 HttpCore will require
Java 1.5 for all its components.
Please note that several classes and methods deprecated between versions 4.0-beta1 and 4.0 GA
(more than two years ago) will also be removed in the 4.2 branch.
Users of 4.0.x versions are advised to upgrade and replace deprecated API calls following
recommendations in javadocs.
* In case of an unexpected end of stream condition (the peer closed connection prematurely)
truncated Content-Length delimited message bodies will cause an I/O exception. Application
can still choose to catch and ignore ConnectionClosedException in order to accept partial
message content.
Contributed by Oleg Kalnichevski
* [HTTPCORE-255]: Fixed resource management in InputStreamEntity#writeTo()
Contributed by Oleg Kalnichevski
* [HTTPCORE-254]: Erratic results from metrics (sebb)
* [HTTPCORE-242]: Fixed NPE in AsyncNHttpClientHandler caused by an early response to an
entity enclosing request.
Contributed by Oleg Kalnichevski
Release 4.1
-------------------
This is the first stable (GA) release of HttpCore 4.1. This release provides a compatibility mode
with JREs that have a naive (broken) implementation of SelectionKey API and also improves
compatibility with the Google Android platform. There has also been a number of performance
related improvements and bug fixes in both blocking and non-blocking components.
Changelog
-------------------
* [HTTPCORE-240]: DefaultConnectingIOReactor leaks a socket descriptor if the session request fails.
Contributed by Oleg Kalnichevski
* [HTTPCORE-239]: The ChunkEncoder could request for a negative buffer limit causing an
IllegalArgumentException.
Contributed by Asankha Perera
* [HTTPCORE-236]: SSLIOSession#isAppInputReady() does not check the status of the session input
buffer.
Contributed by Dmitry Lukyanov
* [HTTPCORE-233]: EntityUtils#toString() and EntityUtils#toByteArray() to return null if
HttpEntity#getContent() is null
Contributed by Oleg Kalnichevski
* [HTTPCORE-231] Fixed incorrect handling of HTTP entities by non-blocking LengthDelimitedDecoder
when the Content-Length value is larger than Integer.MAX_VALUE.
Contributed by Oleg Kalnichevski
Release 4.1-BETA2
-------------------
This is the second BETA release of HttpCore 4.1. This is mainly a bug fix release that addresses
a number of non-critical bugs.
The most significant change in this release is deprecation of the HttpEntity#consumeContent()
method and streamlining of connection management and resource deallocation by HTTP entities.
Please refer to the javadocs for details.
* [HTTPCORE-229] AbstractSessionInputBuffer#readLine(CharArrayBuffer) returns incorrect
number of characters read by the method when using non-standard HTTP element charset.
Contributed by Oleg Kalnichevski
* Non-blocking connections can trigger #responseReady / #requestReady events by mistake
when the underlying session is already closed.
Contributed by Oleg Kalnichevski
* [HTTPCORE-228] Fixed NPE in AsyncNHttpServiceHandler caused by entity enclosing requests
if no matching request handler can be found.
Contributed by Oleg Kalnichevski
* [HTTPCORE-227] Fixed incorrect request / response count by non-blocking connections.
Contributed by Harold Lee
* [HTTPCORE-226] Improved compatibility of NIO components with Google Android.
Contributed by Oleg Kalnichevski
* ByteArrayBuffer, CharArrayBuffer, BasicHeader, BufferedHeader, HeaderGroup, BasicRequestLine,
BasicStatusLine made Serializable.
Contributed by Oleg Kalnichevski
Release 4.1-BETA1
-------------------
This is the first BETA release of HttpCore 4.1. This release finalizes the API introduced in the
4.1 development branch. It also fixes a number of bugs discovered since the previous release and
delivers a number of performance optimizations in the blocking HTTP transport components.
The blocking HTTP transport is expected to be 5% to 10% faster compared to previous releases.
* [HTTPCORE-222] Fixed Import-Package in the OSGi META-INF
Contributed by Willem Jiang
* [HTTPCORE-177] Reduce intermediate data buffering by reading large chunks of data directly from
the underlying socket stream. This results in improved performance of blocking read operations.
Contributed by Oleg Kalnichevski
* [HTTPCORE-220] IdentityDecoder fails to detect end of stream when using file channels.
Contributed by Asankha C. Perera
* [HTTPCORE-218] ChunkEncoder#write method no longer returns incorrect value if
the data to write is greater than the size of the internal buffer used by the encoder.
Contributed by Richie Jefts
* [HTTPCORE-209] Added parameter to set SO_REUSEADDR on sockets bound to a local address.
Contributed by Oleg Kalnichevski
* [HTTPCORE-207] SocketHttp*Connection classes can leak sockets if the connection is half-closed
Contributed by David Koski
Release 4.1-ALPHA1
-------------------
This is the first public release from the 4.1 branch of HttpCore. This release adds a number of
new features, most notable being introduction of compatibility mode with IBM JREs and other JREs
with naive (broken) implementation of SelectionKey API.
Please note new classes and methods added in the 4.1 branch are still considered API unstable.
* Ensure that an attempt is made to close out all active sessions gracefully in case of an abnormal
shutdown of the I/O reactor.
Contributed by Oleg Kalnichevski
* [HTTPCORE-201] OSGi Export-Package to specify release version
Contributed by Oleg Kalnichevski
* [HTTPCORE-183] Added Thread-safe implementations of HttpParams and HttpProcessor -
SyncBasicHttpParams and ImmutableHttpProcessor classes
Contributed by Oleg Kalnichevski
* [HTTPCORE-199] ContentInputStream implements InputStream#available().
Contributed by Oleg Kalnichevski
* [HTTPCORE-195] Truncated chunk-coded streams can now be tolerated by catching and discarding
TruncatedChunkException.
Contributed by Oleg Kalnichevski
* [HTTPCORE-155] Compatibility mode with IBM JRE and other JREs with naive (broken) implementation
of SelectionKey.
Contributed by Marc Beyerle and Oleg Kalnichevski
* [HTTPCORE-191] Blocking HTTP connections are now capable of correctly preserving their internal
state on SocketTimeoutExceptions, which makes it possible to continue reading from the connection
after a socket timeout.
Contributed by Oleg Kalnichevski
* [HTTPCORE-190] ChunkedInputStream is now capable of correctly preserving its internal state on
SocketTimeoutExceptions, which makes it possible to continue reading from the stream after a
socket timeout.
Contributed by Oleg Kalnichevski
Release 4.0.1
-------------------
This is a patch release addressing a number of issues discovered since the 4.0 release. Users
of NIO module are advised to upgrade.
* [HTTPCORE-198] CONNECT request includes Host header for HTTP 1.1 connections.
Contributed by Oleg Kalnichevski
* [HTTPCORE-196] SSLIOSession now unwraps encrypted data more aggressively eliminating long
pauses when receiving data over non-blocking connections.
Contributed by Oleg Kalnichevski
* [HTTPCORE-197] Fixed bug causing the non-blocking ChunkDecoder to report some data stream as
truncated under special conditions.
Contributed by Denis Rogov and Oleg Kalnichevski
* SSLIOSession#isAppOutputReady and SSLIOSession#isAppInputReady no longer ignore the application
event mask causing I/O event notifications for unrequested type of events.
Contributed by Oleg Kalnichevski
* [HTTPCORE-193] Fixed problem with SSLIOSession incorrectly handling of end-of-stream condition.
Contributed by Asankha C. Perera and Oleg Kalnichevski
Release 4.0
-------------------
This is the first stable (GA) release of HttpCore 4.0. This release mainly improves the
documentation and fixes a few minor bugs reported since the previous release. HttpCore
now comes with a complete tutorial presenting an in-depth coverage of the API.
HttpCore is a set of low level HTTP transport components that can be used to build custom
client and server side HTTP services with a minimal footprint. HttpCore supports two I/O
models: blocking I/O model based on the classic Java I/O and non-blocking, event driven I/O
model based on Java NIO. The blocking I/O model may be more appropriate for data intensive,
low latency scenarios, whereas the non-blocking model may be more appropriate for high latency
scenarios where raw data throughput is less important than the ability to handle thousands of
simultaneous HTTP connections in a resource efficient manner.
* [HTTPCORE-180] Fixed NPE in standard I/O event dispatchers when
IOEventDispatch#disconnected fires before the session was fully initialized
(IOEventDispatch#connected was not called).
Contributed by Oleg Kalnichevski
* [HTTPCORE-175] Chunk decoders no longer accept truncated chunks as valid input.
Contributed by Oleg Kalnichevski
Release 4.0 Beta 3
-------------------
The third BETA version of HttpComponents Core has been released. This is a
maintenance release, which addresses a number of issues discovered since the
previous release.
The only significant new feature is an addition of an OSGi compliant bundle
combining HttpCore and HttpCore NIO jars.
* [HTTPCORE-173] Tolerate missing closing chunk if the chunk coded content
is terminated by the end of stream (EOF) condition.
Contributed by Oleg Kalnichevski
* [HTTPCORE-174] Position is incremented twice in ContentLengthInputStream#skip(long)
Contributed by Ildar Safarov
* [HTTPCORE-125] OSGi bundle containing HttpCore & HttpCore NIO jars.
Contributed by Oleg Kalnichevski
* CancelledKeyException thrown in BaseIOReactor#validate() no longer causes
a premature I/O reactor shutdown.
Contributed by Oleg Kalnichevski
* [HTTPCORE-172] Added #close() method to SharedInputBuffer and
SharedOutputBuffer. The purpose of the new method is to close the buffer
in case of normal / orderly termination of the underlying HTTP connection.
Use #shutdown() method to force-close the buffer in case of abnormal /
exceptional termination of the underlying connection.
Contributed by Oleg Kalnichevski
* [HTTPCORE-170] Fixed race condition in SharedOutputBuffer.
Contributed by Jason Walton
* [HTTPCORE-169] Fixed bug causing connecting I/O reactors to shut down due to
ClosedChannelException if a pending session request is cancelled before the new
channel has been registered with the selector.
Contributed by Anders Wallgren
* [HTTPCORE-167] Fixed handling the end of stream (EOF) condition in the #isStale()
check of blocking HTTP connections.
Contributed by Oleg Kalnichevski
* [HTTPCORE-166] NIO reactors now maintain an audit log of fatal exceptions,
which can be used to examine the cause and problems experienced during
the shutdown process.
Contributed by Oleg Kalnichevski
* [HTTPCORE-165] Improved handling of CancelledKeyException in I/O reactors
Contributed by Oleg Kalnichevski
Release 4.0 Beta 2
-------------------
The second BETA version of HttpComponents Core has been released. This release
adds a number of improvements to the NIO components, most notable being improved
asynchronous client side and server side protocol handlers.
There has been a number of important bug fixes in HttpCore NIO module, whereas
HttpCore base module has had very few changes.
All upstream projects dependent on HttpCore NIO are strongly advised to upgrade.
* [HTTPCORE-163] Fixed AbstractMultiworkerIOReactor#execute() to correctly
propagate the original I/O exception in case of an abnormal termination.
Contributed by Patrick Moore
* Changed behavior of IdentityDecoder & LengthDelimitedDecoder to throw
an IOException if data is attempted to be written beyond the length
of a FileChannel. Previously would write nothing.
Contributed by Sam Berlin
* Fixed bug in LengthDelimitedDecoder & IdentityDecoder that caused transfers
to a FileChannel to overwrite arbitrary parts of the file, if data was
buffered in SessionInputBuffer.
Contributed by Sam Berlin
* Fixed concurrency bug in the ThrottlingHttpServerHandler protocol handler.
Contributed by Oleg Kalnichevski
* Fixed bug in SharedInputBuffer that caused input events to be
incorrectly suspended.
Contributed by Asankha C. Perera
* [HTTPCORE-150] Entity implementation that serializes a Java object
Contributed by Andrea Selva
* [HTTPCORE-157] ChunkedOutputStream#flush() now behaves consistently with the
specification of OutputStream#flush().
Contributed by Oleg Kalnichevski
* [HTTPCORE-147] Fixed handling of requests with partially consumed content
in ThrottlingHttpServiceHandler.
Contributed by Oleg Kalnichevski
* [HTTPCORE-92] ChunkEncoder splits input data larger than available space
in the session output buffer into smaller chunks instead of expanding
the buffer.
Contributed by Andrea Selva and
Oleg Kalnichevski
* [HTTPCORE-149] I/O reactors now count period of inactivity since the
time of the last read or write operation. Previously only read
operations resulted in timeout counter reset.
Contributed by Oleg Kalnichevski
* [HTTPCORE-148] Improved asynchronous server and client HTTP protocol
handler implementations.
Contributed by Sam Berlin
* [HTTPCORE-143] Ensure the underlying channel is closed if the session
request is canceled or times out.
Contributed by Oleg Kalnichevski
* [HTTPCORE-140] Fixed timeout handling in ThrottlingHttpServiceHandler.
Contributed by Lorenzo Moretti and
Oleg Kalnichevski
Release 4.0 Beta 1
-------------------
The first BETA version of HttpComponents Core has been released. This release
can be considered a major milestone, as it marks the end of API instability
in HttpCore. As of this release the API compatibility between minor releases
in 4.x codeline will be maintained.
This release includes several major improvements such as enhanced HTTP message
parsing API and optimized parser implementations, Java 5.0 compatibility
for HttpCore NIO extensions. Upstream projects are strongly encouraged to
upgrade to the latest release.
The focus of the development efforts will be gradually shifting towards
providing better test coverage, documentation and performance optimizations.
Changelog:
----------
* [HTTPCORE-141] Session request timeout in DefaultConnectingIOReactor
invalidates the request.
Contributed by Oleg Kalnichevski
* [HTTPCORE-137] DefaultHttpRequestFactory extended to support all methods
specified in RFC 2616 (except CONNECT).
Contributed by Oleg Kalnichevski
* Replaced HTTP parameter linking with a simple child/parent stack.
Contributed by Oleg Kalnichevski
* [HTTPCORE-134] all serialVersionUID attributes are private
Contributed by Roland Weber
* [HTTPCORE-133] Clone support for basic HTTP message elements and
non-streaming entities.
Contributed by Oleg Kalnichevski
* [HTTPCORE-127] Improved API for lifecycle management of listening I/O
reactors. One can now suspend and resume listener endpoints.
Contributed by Asankha C. Perera
* [HTTPCORE-112] DefaultConnectionReuseStrategy interprets token sequences
Contributed by Roland Weber
* [HTTPCORE-122] new interface TokenIterator and basic implementation
Contributed by Roland Weber
* HttpCore NIOSSL classes moved to HttpCore NIO.
Contributed by Oleg Kalnichevski
* HttpCore NIO ported to Java 1.5.
Contributed by Oleg Kalnichevski
* [HTTPCORE-130] Fixed over-synchronization bug leading to a thread deadlock
condition in SSL IOEventDispatch implementations.
Contributed by Oleg Kalnichevski
* [HTTPCORE-37] HttpParams beans
Contributed by Stojce Dimski
* [HTTPCORE-128] Simplified injection of custom NIO connection implementations.
Contributed by Oleg Kalnichevski
* [HTTPCORE-126] Improved HTTP message parsing API and optimized parser
implementations.
Contributed by Oleg Kalnichevski
* Do not include "Connection: close" to 500 responses per default.
Contributed by Oleg Kalnichevski
* [HTTPCORE-121] new interface HeaderElementIterator
Contributed by Andrea Selva
* [HTTPCORE-123] Fixed problem with SSLSession losing buffered data, if the
connection has been closed by the peer.
Contributed by Risto Reinpõld
Release 4.0 Alpha 6
-------------------
The sixth ALPHA version of HttpComponents Core has been released. This release
sports an improved message parsing and formatting API in the base module and
lots of incremental improvements and bug fixes in the NIO and NIOSSL modules.
Based on the improved API, it is now possible to send and receive SIP messages
with HttpComponents Core.
HttpCore is now feature complete and we are planning to freeze the public APIs
as of next release (BETA1).
* [HTTPCORE-120] new interface HeaderIterator, available from HttpMessage
Contributed by Roland Weber
* [HTTPCORE-118] Purge closed sessions prior to opening new ones. This should
reduce chances of running out of memory when opening and closing lots of
NIO connections in a tight loop.
Contributed by Oleg Kalnichevski
* [HTTPCORE-117] Fixed bug preventing protocol handlers from closing timed out
NIO connection when pending output (output session buffer is not empty).
Contributed by Oleg Kalnichevski
* [HTTPCORE-86] Allow for optional handling of runtime exceptions
thrown by protocol handlers to ensure the I/O dispatch thread
remains running.
Contributed by Oleg Kalnichevski
* [HTTPCORE-116] moved parameter names to interfaces
Contributed by Roland Weber
* [HTTPCORE-109] Improved shutdown process of the I/O reactors in NIO modules.
I/O reactors now attempt to terminate connections gracefully before shutting
down the underlying socket channels.
Contributed by Oleg Kalnichevski
* [HTTPCORE-107] allow sending and receiving of SIP messages
Contributed by Roland Weber
* [HTTPCORE-114]: Fixed incorrect handling of the end-of-stream condition
in SSLIOSession.
Oleg Kalnichevski
* [HTTPCORE-110] refactored message parsing and formatting logic
Contributed by Roland Weber
* [HTTPCORE-113] Removed unnecessary target hostname resolution from
non-blocking client protocol handlers.
Oleg Kalnichevski
* [HTTPCORE-108] Close all channels registered with the I/O reactor during
shutdown. Fixed the problem with DefaultListeningIOReactor not releasing
socket ports until JVM is restarted.
Oleg Kalnichevski
* [HTTPCORE-106] Pluggable HTTP message parsers and message writers
Oleg Kalnichevski
* [HTTPCORE-105] Consistent class names in base and NIO modules
Oleg Kalnichevski
* [HTTPCORE-100] revised HttpContext hierarchy
Contributed by Roland Weber
* [HTTPCORE-103] NIO connections now attempt to consume all available session
data while parsing HTTP messages. This can potentially improve performance
of non-blocking SSL connections.
Contributed by Steffen Pingel
* [HTTPCORE-102] Exceeding of maximum line length limit detected late
Contributed by Steffen Pingel
* [HTTPCORE-21] Transport and connection metrics
Contributed by Andrea Selva and
Oleg Kalnichevski
* [HTTPCORE-91] new interceptor RequestDate, renamed constants in protocol.HTTP
Contributed by Roland Weber
* [HTTPCORE-90] Version detection based on build-time properties
Contributed by Oleg Kalnichevski and
Roland Weber
* [HTTPCORE-88] Added convenience methods to HttpRequestInterceptorList,
HttpResponseInterceptorList interfaces
Contributed by Andrea Selva
* [HTTPCORE-89]: Fixed bug in DefaultConnectingIOReactor causing incorrect
handling of local (immediate) connections on some platforms (affects Sun
Solaris 2.9 / Sparc and likely other Solaris 2.x platforms)
Contributed by Sam Berlin
Release 4.0 Alpha 5
-------------------
The fifth ALPHA version of HttpComponents Core has been released. This release
delivers a number of incremental improvements across the board in all modules
and adds several performance oriented features such as ability to transfer
data directly between a file and a socket channels.
HttpCore is almost fully feature complete now and we are likely to freeze
the public APIs as of next release (BETA1).
* [HTTPCORE-87] RuntimeExcpetions thrown in I/O worker threads are now correctly
propagated to the I/O reactor.
Contributed by Oleg Kalnichevski
* [HTTPCORE-84]: Removed DateUtils/DateParseException from core.
Contributed by Roland Weber
* [HTTPCORE-63]: Made I/O select interval configurable for all default I/O
reactor implementations.
Contributed by Oleg Kalnichevski and
Anders Wallgren
* [HTTPCORE-82]: Revised linking of HttpParams to reduce potential for misuse.
Method #setDefaults() removed from the HttpParams interface.
Contributed by Roland Weber
* [HTTPCORE-81]: Maximum line length and maximum header counts parameters are now
correctly enforced in both base and NIO modules. Fixed maximum line length check
when parsing folded header lines.
Contributed by Steffen Pingel
* Added HTTP client handler implementation that allocates fixed size content
buffers upon initialization and is capable of throttling the rate of I/O events
in order to make sure those content buffers do not get overflown.
Contributed by Oleg Kalnichevski
* [HTTPCORE-76]: Added IOSession#shutdown() method intended to force-close
I/O sessions (primarily needed to terminate hung SSL connections).
Contributed by Sandeep Tamhankar
* [HTTPCORE-78]: Added ByteBufferAllocator interface that can be used to apply
different ByteArray allocation strategies to session and content buffers.
Use heap bound implementation for short-lived or variable in length (requiring
frequent content re-allocation) buffers.
Contributed by Steffen Pingel
* [HTTPCORE-77]: The result of CharsetDecoder#decode() and CharsetEncoder#encode()
was not checked for errors resulting in an infinite loop in
SessionInputBuffer#readLine() and SessionOutputBuffer#writeLine()
when malformed characters were processed.
Contributed by Steffen Pingel
* [HTTPCORE-71]: HttpParams can be copied.
Contributed by Roland Weber
* [HTTPCORE-75]: DefaultNHttpServerConnection and DefaultNHttpClientConnection
now correctly terminate the underlying I/O session when closed.
BufferingHttpServiceHandler now correctly applies connection keep-alive
strategy when sending a response with no content body.
Contributed by Steffen Pingel
* [HTTPCORE-73]: Fixed bug preventing NHttpServiceHandler#responseReady and
NHttpClientHandler#requestReady events from being fired if the HTTP message
has no content body.
Contributed by Steffen Pingel
* [HTTPCORE-67]: Improved event listener interface
Contributed by Oleg Kalnichevski
* [HTTPCORE-43]: Support for FileChannel#transferFrom() and
FileChannel#transferTo() methods. Direct coping from and to FileChannel is
expected to improve performance of file bound operations
Contributed by Andrea Selva
* [HTTPCORE-66]: Fixed handling of HTTP HEAD methods
Contributed by Steffen Pingel and
Oleg Kalnichevski
* [HTTPCORE-58]: NIO HTTP connections changed to throw checked
ConnectionClosedException instead of unchecked IllegalStateException when
an attempt is made to perform an I/O operation on a closed conection
Contributed by Oleg Kalnichevski
* [HTTPCORE-56]: DefaultConnectingIOReactor no longer terminates due to a
CancelledKeyException, if a session request gets canceled before selection
key is fully initialized.
Contributed by Oleg Kalnichevski
Release 4.0 Alpha 4
-------------------
The forth ALPHA version of HttpComponents Core has been released.
The ALPHA4 release fixes a number of bugs and adds a number of
improvements to HttpCore base and HttpCore NIO extensions.
HttpCore NIO can be used to build HTTP services intended to handle
thousands of simultaneous connections with a small number of I/O
threads. This release also introduces NIOSSL extensions that can be
used to extend HttpCore non-blocking transport components with
ability to transparently encrypt data in transit using SSL/TLS protocol.
* [HTTPCORE-49]: DefaultConnectingIOReactor can now correctly handle
unresolved socket addresses. It no longer terminates with the
UnresolvedAddressException runtime exception.
Contributed by Oleg Kalnichevski
* [HTTPCORE-42]: Added server side API for the expectation verification.
Improved support for the 'expect: continue' handshake in HttpCore and
HttpCore NIO.
Contributed by Oleg Kalnichevski
* [HTTPCORE-26]: Added SSL support for HttpCore NIO.
Contributed by Oleg Kalnichevski
* [HTTPCORE-40]: API classes no longer reference impl classes in module-main.
Contributed by Roland Weber
* [HTTPCORE-39]: Refactored HttpStatus, spun off [English]ReasonPhraseFactory.
Contributed by Roland Weber
* [HTTPCORE-32]: HttpRequestInterceptorList, HttpResponseInterceptorList
Contributed by Roland Weber
* [HTTPCORE-38]: Packages nio.impl.* are now impl.nio.*, same for examples.
Contributed by Roland Weber
* [HTTPCORE-27]: I/O reactors can now accept a thread factory as an optional
parameter.
Contributed by Oleg Kalnichevski
* [HTTPCORE-36]: Fixed #setHandlers() method and matching of request URIs
with a query part in HttpRequestHandlerRegistry
Contributed by Oleg Kalnichevski
* [HTTPCORE-28]: DefaultConnectingIOReactor now maintains a queue of connect
requests and registers new sessions with the selector on the I/O thread.
Contributed by Oleg Kalnichevski
* [HTTPCORE-29] DefaultConnectingIOReactor changed to ensure IOExceptions
are correctly propagated to the caller, if an exception is thrown while
initializing a newly connected socket.
Contributed by Oleg Kalnichevski
* [HTTPCORE-24] Fixed bug in non-blocking connection implementations, which
prevented the session buffer from being correctly flushed when the content
coding process has been completed.
Contributed by Oleg Kalnichevski
* [HTTPCORE-23] Fixed threading bug in DefaultConnectingIOReactor.
Contributed by Asankha C. Perera
Release 4.0 Alpha 3
-------------------
The third ALPHA version of HttpCore has been released. The ALPHA3 release
includes a number of API optimizations and improvements and introduces a set
of NIO extensions to the HttpCore API. NIO extensions can be used to build
HTTP services intended to handle thousands of simultaneous connections with
a small number of I/O threads.
* [HTTPCORE-15] Provided a interafce to access IP address of the local and
remote end points.
Contributed by Oleg Kalnichevski
* [ HTTPCORE-14] Scheme, SocketFactory and SecureSocketFactory moved to
HttpClient. Decoupled HttpHost and Scheme.
Contributed by Oleg Kalnichevski
* [HTTPCORE-13] Refactored HttpProcessor interface and related impl classes
Contributed by Roland Weber
* [HTTPCORE-11] Client connection interface no longer defines a specific
method to open a connection. HTTP connections can now represent any
abstract I/O transport such as those based on NIO API.
Contributed by Oleg Kalnichevski
* [HTTPCORE-10] Non-blocking (async) client side I/O transport based on NIO.
Contributed by Oleg Kalnichevski
* [HTTPCORE-9] Non-blocking (async) server side I/O transport based on NIO.
Contributed by Oleg Kalnichevski
* [HTTPCORE-7] ConnectionReuseStrategy interface changed to allow access
to the HTTP execution context.
Contributed by Roland Weber
* [HTTPCORE-6] Header implementation allowing for performance short-cuts
when serializing and deserializing HTTP headers.
Contributed by Oleg Kalnichevski
* [HTTPCORE-5] Header, HeaderElement, NameValuePair, RequestLine, StatusLine,
HttpVersion changed to interfaces. API no longer contains any parsing and
formatting code and does not imply any specific physical representation of
HTTP messages and their elements.
Contributed by Oleg Kalnichevski
Release 4.0 Alpha 2
-------------------
This is a maintenance release that mostly fixes minor problems found since the
previous release. The upstream projects are strongly encouraged use this
release as a dependency while HttpCore undergoes another round of reviews
and optimization in the SVN trunk
Changelog:
---------
* [HTTPCORE-4] optional header and line length limits to contain OOME risks
Contributed by Oleg Kalnichevski
Release 4.0 Alpha 1
-------------------
This release represents a complete redesign of the Jakarta Commons HttpClient
3.x API and a significant rewrite of the core HTTP components derived from
HttpClient 3.0 code base.
These components will form the foundation of the future releases of Jakarta
HttpClient and can also be used separately to build custom client- and
server-side HTTP services.
httpcomponents-core-4.4.4/pom.xml 0100644 0000000 0000000 00000031136 12613456023 015610 0 ustar 00 0000000 0000000
projectorg.apache.httpcomponents7../project/pom.xml4.0.0httpcomponents-coreApache HttpComponents Core4.4.4Apache HttpComponents Core is a library of components for building HTTP enabled serviceshttp://hc.apache.org/httpcomponents-core2005pomThe Apache Software Foundationhttp://www.apache.org/Apache License, Version 2.0http://www.apache.org/licenses/LICENSE-2.0.txtrepoJirahttp://issues.apache.org/jira/browse/HTTPCOREscm:svn:https://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.4.4scm:svn:https://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.4.4https://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.4.4httpcorehttpcore-niohttpcore-osgihttpcore-ab1.61.6false4.111.8.51.24.41junitjunit${junit.version}testorg.mockitomockito-core${mockito.version}testcommons-loggingcommons-logging${commons-logging.version}testmaven-jar-pluginHttpComponents ${project.name}${project.version}The Apache Software FoundationHttpComponents ${project.name}${project.version}The Apache Software Foundationorg.apache${project.url}maven-source-pluginattach-sourcesjarmaven-javadoc-pluginattach-javadocsjartrue${maven.compiler.source}
http://docs.oracle.com/javase/6/docs/api/
maven-site-plugincom.agilejava.docbkxdocbkx-maven-pluginorg.docbookdocbook-xml4.4runtimetutorial-sitegenerate-htmlgenerate-pdfpre-siteindex.xmltruetruesrc/docbkx/resources/xsl/fopdf.xslsrc/docbkx/resources/xsl/html_chunk.xslcss/hc-tutorial.cssversion${project.version}maven-resources-plugincopy-resourcespre-sitecopy-resources${basedir}/target/site/examplessrc/examplesfalseorg.apache.maven.pluginsmaven-checkstyle-plugin2.9.1org.apache.httpcomponentshc-stylecheck${hc.stylecheck.version}UTF-8validate-mainvalidatehc-stylecheck/default.xmlhc-stylecheck/asl2.headertruetruefalse${basedir}/src/maincheckstylevalidate-testvalidatehc-stylecheck/default.xmlhc-stylecheck/asl2.headertruetruefalse${basedir}/src/testcheckstylevalidate-examplesvalidatehc-stylecheck/minimal.xmlhc-stylecheck/asl2.headertruetruefalse${basedir}/src/examplescheckstyleorg.codehaus.mojoclirr-maven-plugin${hc.clirr.version}${api.comparison.version}org.apache.ratapache-rat-plugin0.11verifychecksrc/docbkx/resources/**src/test/resources/*.truststoremaven-project-info-reports-plugin${hc.project-info.version}falsedependency-managementissue-trackinglicensescmsummaryorg.codehaus.mojoclirr-maven-plugin${hc.clirr.version}${api.comparison.version}
httpcomponents-core-4.4.4/httpcore-osgi/ 0040755 0000000 0000000 00000000000 12613456334 017066 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/pom.xml 0100644 0000000 0000000 00000020666 12613456012 020403 0 ustar 00 0000000 0000000
4.0.0org.apache.httpcomponentshttpcomponents-core4.4.4httpcore-osgiApache HttpCore OSGi bundle2005
Apache HttpComponents Core (OSGi bundle)
http://hc.apache.org/httpcomponents-core-gabundle2.0.03.5.01.5.41.0.1org.apache.httpcomponentshttpcore${project.version}org.apache.httpcomponentshttpcore${project.version}test-jartestorg.apache.httpcomponentshttpcore-nio${project.version}org.ops4j.pax.exampax-exam-container-native${pax.exam.version} org.osgiorg.osgi.coretestorg.ops4j.pax.exampax-exam-junit4test${pax.exam.version}org.ops4j.pax.exampax-exam-link-mvntest${pax.exam.version}org.ops4j.pax.urlpax-url-aether${pax.url.version}testorg.ops4j.pax.urlpax-url-wrap${pax.url.version}test org.osgiorg.osgi.coreorg.slf4jslf4j-api1.6.4testch.qos.logbacklogback-classic${logback.version}testch.qos.logbacklogback-core${logback.version}testorg.apache.felixorg.apache.felix.framework4.2.0testorg.apache.servicemix.toolingdepends-maven-plugin1.2generate-depends-filegenerate-resourcesgenerate-depends-fileorg.apache.felixmaven-bundle-plugintrueApache ${project.name}${project.groupId}.httpcore
<_exportcontents>org.apache.http.*;version=${project.version}
*;scope=compile|runtime;inline=trueorg.codehaus.mojoclirr-maven-plugintrueorg.apache.maven.pluginsmaven-failsafe-plugin${hc.surefire.version}itintegration-testverify**/*IT.class${project.build.directory}${project.version}trueorg.apache.httpcomponents.httpcore_${project.version}org.codehaus.mojoclirr-maven-plugin${hc.clirr.version}truemaven-project-info-reports-plugin${hc.project-info.version}falsedependenciesdependency-infosummarydisableOSGiTestsdisableOSGiTeststrueorg.apache.maven.pluginsmaven-failsafe-plugintrue
httpcomponents-core-4.4.4/httpcore-osgi/src/ 0040755 0000000 0000000 00000000000 12613456012 017646 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/ 0040755 0000000 0000000 00000000000 12613456012 020625 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/ 0040755 0000000 0000000 00000000000 12613456011 021545 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/ 0040755 0000000 0000000 00000000000 12613456011 022334 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/ 0040755 0000000 0000000 00000000000 12613456011 023555 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/ 0040755 0000000 0000000 00000000000 12613456011 024534 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/osgi/ 0040755 0000000 0000000 00000000000 12613456012 025476 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/osgi/Common.java 0100644 0000000 0000000 00000010713 12613456012 027570 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.osgi;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
import org.ops4j.pax.exam.util.PathUtils;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
import static org.ops4j.pax.exam.CoreOptions.bundle;
import static org.ops4j.pax.exam.CoreOptions.junitBundles;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.wrappedBundle;
/**
* Test inherit from this.
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class Common {
public static String getDependencyVersion(final String groupId, final String artifactId) {
final URL depPropsUrl = Common.class.getResource("/META-INF/maven/dependencies.properties");
final Properties depProps = new Properties();
try {
depProps.load(depPropsUrl.openStream());
} catch (IOException e) {
throw new RuntimeException(e);
}
String ver = (String) depProps.get(String.format("%s/%s/version", groupId, artifactId));
if (ver == null) {
throw new RuntimeException(String.format("No version available for %s:%s", groupId, artifactId));
}
ver = ver.replace("-SNAPSHOT", ".SNAPSHOT");
return ver;
}
@Configuration
public static Option[] config() {
final String projectVersion = System.getProperty("project.version");
final String buildDir = System.getProperty("project.build.directory", "target");
final String paxLoggingLevel = System.getProperty("bt.osgi.pax.logging.level", "WARN");
return options(
bundle(String.format("file:%s/org.apache.httpcomponents.httpcore_%s.jar",
buildDir,
projectVersion)),
wrappedBundle(mavenBundle().groupId("org.apache.httpcomponents")
.artifactId("httpcore")
.version(projectVersion)
.classifier("tests"))
.exports("org.apache.http.integration")
.imports("org.apache.http.protocol",
"org.apache.http",
"org.apache.http.config",
"org.apache.http.entity",
"org.apache.http.impl",
"org.apache.http.impl.bootstrap",
"org.apache.http.util",
"org.apache.http.message",
"org.apache.commons.logging; provider=paxlogging",
"org.junit"),
junitBundles(),
systemProperty("pax.exam.osgi.unresolved.fail").value("true"),
systemProperty("pax.exam.logging").value("none"),
systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value(paxLoggingLevel),
systemProperty("logback.configurationFile")
.value("file:" + PathUtils.getBaseDir() + "/src/test/resources/logback.xml")
);
}
}
httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/osgi/ConcurrentIT.java 0100644 0000000 0000000 00000003535 12613456012 030723 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.osgi;
import org.apache.http.concurrent.BasicFuture;
import org.apache.http.concurrent.FutureCallback;
import org.junit.Test;
/**
* Is the concurrent package to be had?
*/
public class ConcurrentIT extends Common {
@Test
public void testCompleted() throws Exception {
new BasicFuture(new FutureCallback() {
@Override
public void completed(final Void result) {
//
}
@Override
public void failed(final Exception ex) {
//
}
@Override
public void cancelled() {
//
}
}) {};
}
}
httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/osgi/ActuallyConnectIT.java 0100644 0000000 0000000 00000003375 12613456012 031673 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.osgi;
import org.apache.http.integration.TestSyncHttp;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerClass;
/**
* Use the test methods from TestSyncHttp.
*/
@RunWith(PaxExam.class)
@ExamReactorStrategy(PerClass.class)
public class ActuallyConnectIT extends TestSyncHttp {
@Configuration
public static Option[] options() {
return Common.config();
}
}
httpcomponents-core-4.4.4/httpcore-osgi/src/test/java/org/apache/http/osgi/AnnotationIT.java 0100644 0000000 0000000 00000002741 12613456012 030711 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.osgi;
import org.apache.http.annotation.Immutable;
import org.junit.Test;
/**
* Are the annotations to be had?
*/
public class AnnotationIT extends Common {
@Immutable
static class SomeClass {
//
}
@Test
public void anything() {
new SomeClass();
}
}
httpcomponents-core-4.4.4/httpcore-osgi/src/test/resources/ 0040755 0000000 0000000 00000000000 12613456012 022637 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/test/resources/logback.xml 0100644 0000000 0000000 00000003002 12613456012 024753 0 ustar 00 0000000 0000000
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n
httpcomponents-core-4.4.4/httpcore-osgi/src/main/ 0040755 0000000 0000000 00000000000 12613456012 020572 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/main/appended-resources/ 0040755 0000000 0000000 00000000000 12613456012 024362 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/main/appended-resources/META-INF/ 0040755 0000000 0000000 00000000000 12613456012 025522 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore-osgi/src/main/appended-resources/META-INF/NOTICE 0100644 0000000 0000000 00000000210 12613456012 026414 0 ustar 00 0000000 0000000 This project contains annotations derived from JCIP-ANNOTATIONS
Copyright (c) 2005 Brian Goetz and Tim Peierls. See http://www.jcip.net
httpcomponents-core-4.4.4/httpcore-osgi/src/main/appended-resources/META-INF/LICENSE 0100644 0000000 0000000 00000026564 12613456012 026541 0 ustar 00 0000000 0000000
=========================================================================
This project contains annotations in the package org.apache.http.annotation
which are derived from JCIP-ANNOTATIONS
Copyright (c) 2005 Brian Goetz and Tim Peierls.
See http://www.jcip.net and the Creative Commons Attribution License
(http://creativecommons.org/licenses/by/2.5)
Full text: http://creativecommons.org/licenses/by/2.5/legalcode
License
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
"Licensor" means the individual or entity that offers the Work under the terms of this License.
"Original Author" means the individual or entity who created the Work.
"Work" means the copyrightable work of authorship offered under the terms of this License.
"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
to create and reproduce Derivative Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
For the avoidance of doubt, where the work is a musical composition:
Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested.
If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
httpcomponents-core-4.4.4/httpcore/ 0040755 0000000 0000000 00000000000 12613456106 016124 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/pom.xml 0100644 0000000 0000000 00000012622 12613456022 017436 0 ustar 00 0000000 0000000
4.0.0org.apache.httpcomponentshttpcomponents-core4.4.4httpcoreApache HttpCore2005
Apache HttpComponents Core (blocking I/O)
http://hc.apache.org/httpcomponents-core-gajarjunitjunittestorg.mockitomockito-coretestcommons-loggingcommons-loggingtestorg.codehaus.mojobuild-helper-maven-plugin1.8add-sourcegenerate-sourcesadd-sourcesrc/main/java-deprecatedorg.apache.ratapache-rat-pluginverifycheck.externalToolBuilders/**.pmdmaven-eclipse.xmlorg.apache.maven.pluginsmaven-jar-plugin2.6test-jarsrc/main/resourcestrue**/*.propertiesmaven-javadoc-plugin${hc.javadoc.version}true${maven.compiler.source}
http://docs.oracle.com/javase/6/docs/api/
javadocmaven-project-info-reports-plugin${hc.project-info.version}falsedependenciesdependency-infosummarymaven-jxr-plugin${hc.jxr.version}maven-surefire-report-plugin${hc.surefire-report.version}
httpcomponents-core-4.4.4/httpcore/src/ 0040755 0000000 0000000 00000000000 12613456022 016710 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/ 0040755 0000000 0000000 00000000000 12613456022 020526 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/org/ 0040755 0000000 0000000 00000000000 12613456022 021315 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/ 0040755 0000000 0000000 00000000000 12613456022 022536 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/ 0040755 0000000 0000000 00000000000 12613456022 023515 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/ 0040755 0000000 0000000 00000000000 12613456022 025333 5 ustar 00 0000000 0000000 httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java 0100644 0000000 0000000 00000027621 12613456022 032507 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.examples;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ServerSocket;
import java.net.Socket;
import org.apache.http.ConnectionClosedException;
import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.HttpClientConnection;
import org.apache.http.HttpException;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.HttpRequestInterceptor;
import org.apache.http.HttpResponse;
import org.apache.http.HttpResponseInterceptor;
import org.apache.http.HttpServerConnection;
import org.apache.http.impl.DefaultBHttpClientConnection;
import org.apache.http.impl.DefaultBHttpServerConnection;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.HTTP;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpCoreContext;
import org.apache.http.protocol.HttpProcessor;
import org.apache.http.protocol.HttpRequestExecutor;
import org.apache.http.protocol.HttpRequestHandler;
import org.apache.http.protocol.HttpService;
import org.apache.http.protocol.ImmutableHttpProcessor;
import org.apache.http.protocol.RequestConnControl;
import org.apache.http.protocol.RequestContent;
import org.apache.http.protocol.RequestExpectContinue;
import org.apache.http.protocol.RequestTargetHost;
import org.apache.http.protocol.RequestUserAgent;
import org.apache.http.protocol.ResponseConnControl;
import org.apache.http.protocol.ResponseContent;
import org.apache.http.protocol.ResponseDate;
import org.apache.http.protocol.ResponseServer;
import org.apache.http.protocol.UriHttpRequestHandlerMapper;
/**
* Elemental HTTP/1.1 reverse proxy.
*/
public class ElementalReverseProxy {
private static final String HTTP_IN_CONN = "http.proxy.in-conn";
private static final String HTTP_OUT_CONN = "http.proxy.out-conn";
private static final String HTTP_CONN_KEEPALIVE = "http.proxy.conn-keepalive";
public static void main(final String[] args) throws Exception {
if (args.length < 1) {
System.err.println("Please specified target hostname and port");
System.exit(1);
}
final String hostname = args[0];
int port = 80;
if (args.length > 1) {
port = Integer.parseInt(args[1]);
}
final HttpHost target = new HttpHost(hostname, port);
final Thread t = new RequestListenerThread(8888, target);
t.setDaemon(false);
t.start();
}
static class ProxyHandler implements HttpRequestHandler {
private final HttpHost target;
private final HttpProcessor httpproc;
private final HttpRequestExecutor httpexecutor;
private final ConnectionReuseStrategy connStrategy;
public ProxyHandler(
final HttpHost target,
final HttpProcessor httpproc,
final HttpRequestExecutor httpexecutor) {
super();
this.target = target;
this.httpproc = httpproc;
this.httpexecutor = httpexecutor;
this.connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
}
public void handle(
final HttpRequest request,
final HttpResponse response,
final HttpContext context) throws HttpException, IOException {
final HttpClientConnection conn = (HttpClientConnection) context.getAttribute(
HTTP_OUT_CONN);
context.setAttribute(HttpCoreContext.HTTP_CONNECTION, conn);
context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
System.out.println(">> Request URI: " + request.getRequestLine().getUri());
// Remove hop-by-hop headers
request.removeHeaders(HTTP.CONTENT_LEN);
request.removeHeaders(HTTP.TRANSFER_ENCODING);
request.removeHeaders(HTTP.CONN_DIRECTIVE);
request.removeHeaders("Keep-Alive");
request.removeHeaders("Proxy-Authenticate");
request.removeHeaders("TE");
request.removeHeaders("Trailers");
request.removeHeaders("Upgrade");
this.httpexecutor.preProcess(request, this.httpproc, context);
final HttpResponse targetResponse = this.httpexecutor.execute(request, conn, context);
this.httpexecutor.postProcess(response, this.httpproc, context);
// Remove hop-by-hop headers
targetResponse.removeHeaders(HTTP.CONTENT_LEN);
targetResponse.removeHeaders(HTTP.TRANSFER_ENCODING);
targetResponse.removeHeaders(HTTP.CONN_DIRECTIVE);
targetResponse.removeHeaders("Keep-Alive");
targetResponse.removeHeaders("TE");
targetResponse.removeHeaders("Trailers");
targetResponse.removeHeaders("Upgrade");
response.setStatusLine(targetResponse.getStatusLine());
response.setHeaders(targetResponse.getAllHeaders());
response.setEntity(targetResponse.getEntity());
System.out.println("<< Response: " + response.getStatusLine());
final boolean keepalive = this.connStrategy.keepAlive(response, context);
context.setAttribute(HTTP_CONN_KEEPALIVE, new Boolean(keepalive));
}
}
static class RequestListenerThread extends Thread {
private final HttpHost target;
private final ServerSocket serversocket;
private final HttpService httpService;
public RequestListenerThread(final int port, final HttpHost target) throws IOException {
this.target = target;
this.serversocket = new ServerSocket(port);
// Set up HTTP protocol processor for incoming connections
final HttpProcessor inhttpproc = new ImmutableHttpProcessor(
new HttpRequestInterceptor[] {
new RequestContent(),
new RequestTargetHost(),
new RequestConnControl(),
new RequestUserAgent("Test/1.1"),
new RequestExpectContinue(true)
});
// Set up HTTP protocol processor for outgoing connections
final HttpProcessor outhttpproc = new ImmutableHttpProcessor(
new HttpResponseInterceptor[] {
new ResponseDate(),
new ResponseServer("Test/1.1"),
new ResponseContent(),
new ResponseConnControl()
});
// Set up outgoing request executor
final HttpRequestExecutor httpexecutor = new HttpRequestExecutor();
// Set up incoming request handler
final UriHttpRequestHandlerMapper reqistry = new UriHttpRequestHandlerMapper();
reqistry.register("*", new ProxyHandler(
this.target,
outhttpproc,
httpexecutor));
// Set up the HTTP service
this.httpService = new HttpService(inhttpproc, reqistry);
}
@Override
public void run() {
System.out.println("Listening on port " + this.serversocket.getLocalPort());
while (!Thread.interrupted()) {
try {
final int bufsize = 8 * 1024;
// Set up incoming HTTP connection
final Socket insocket = this.serversocket.accept();
final DefaultBHttpServerConnection inconn = new DefaultBHttpServerConnection(bufsize);
System.out.println("Incoming connection from " + insocket.getInetAddress());
inconn.bind(insocket);
// Set up outgoing HTTP connection
final Socket outsocket = new Socket(this.target.getHostName(), this.target.getPort());
final DefaultBHttpClientConnection outconn = new DefaultBHttpClientConnection(bufsize);
outconn.bind(outsocket);
System.out.println("Outgoing connection to " + outsocket.getInetAddress());
// Start worker thread
final Thread t = new ProxyThread(this.httpService, inconn, outconn);
t.setDaemon(true);
t.start();
} catch (final InterruptedIOException ex) {
break;
} catch (final IOException e) {
System.err.println("I/O error initialising connection thread: "
+ e.getMessage());
break;
}
}
}
}
static class ProxyThread extends Thread {
private final HttpService httpservice;
private final HttpServerConnection inconn;
private final HttpClientConnection outconn;
public ProxyThread(
final HttpService httpservice,
final HttpServerConnection inconn,
final HttpClientConnection outconn) {
super();
this.httpservice = httpservice;
this.inconn = inconn;
this.outconn = outconn;
}
@Override
public void run() {
System.out.println("New connection thread");
final HttpContext context = new BasicHttpContext(null);
// Bind connection objects to the execution context
context.setAttribute(HTTP_IN_CONN, this.inconn);
context.setAttribute(HTTP_OUT_CONN, this.outconn);
try {
while (!Thread.interrupted()) {
if (!this.inconn.isOpen()) {
this.outconn.close();
break;
}
this.httpservice.handleRequest(this.inconn, context);
final Boolean keepalive = (Boolean) context.getAttribute(HTTP_CONN_KEEPALIVE);
if (!Boolean.TRUE.equals(keepalive)) {
this.outconn.close();
this.inconn.close();
break;
}
}
} catch (final ConnectionClosedException ex) {
System.err.println("Client closed connection");
} catch (final IOException ex) {
System.err.println("I/O error: " + ex.getMessage());
} catch (final HttpException ex) {
System.err.println("Unrecoverable HTTP protocol violation: " + ex.getMessage());
} finally {
try {
this.inconn.shutdown();
} catch (final IOException ignore) {}
try {
this.outconn.shutdown();
} catch (final IOException ignore) {}
}
}
}
}
httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java 0100644 0000000 0000000 00000010247 12613456022 031405 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.examples;
import java.net.Socket;
import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.impl.DefaultBHttpClientConnection;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.message.BasicHttpRequest;
import org.apache.http.protocol.HttpCoreContext;
import org.apache.http.protocol.HttpProcessor;
import org.apache.http.protocol.HttpProcessorBuilder;
import org.apache.http.protocol.HttpRequestExecutor;
import org.apache.http.protocol.RequestConnControl;
import org.apache.http.protocol.RequestContent;
import org.apache.http.protocol.RequestExpectContinue;
import org.apache.http.protocol.RequestTargetHost;
import org.apache.http.protocol.RequestUserAgent;
import org.apache.http.util.EntityUtils;
/**
* Elemental example for executing multiple GET requests sequentially.
*/
public class ElementalHttpGet {
public static void main(String[] args) throws Exception {
HttpProcessor httpproc = HttpProcessorBuilder.create()
.add(new RequestContent())
.add(new RequestTargetHost())
.add(new RequestConnControl())
.add(new RequestUserAgent("Test/1.1"))
.add(new RequestExpectContinue(true)).build();
HttpRequestExecutor httpexecutor = new HttpRequestExecutor();
HttpCoreContext coreContext = HttpCoreContext.create();
HttpHost host = new HttpHost("localhost", 8080);
coreContext.setTargetHost(host);
DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 1024);
ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
try {
String[] targets = {
"/",
"/servlets-examples/servlet/RequestInfoExample",
"/somewhere%20in%20pampa"};
for (int i = 0; i < targets.length; i++) {
if (!conn.isOpen()) {
Socket socket = new Socket(host.getHostName(), host.getPort());
conn.bind(socket);
}
BasicHttpRequest request = new BasicHttpRequest("GET", targets[i]);
System.out.println(">> Request URI: " + request.getRequestLine().getUri());
httpexecutor.preProcess(request, httpproc, coreContext);
HttpResponse response = httpexecutor.execute(request, conn, coreContext);
httpexecutor.postProcess(response, httpproc, coreContext);
System.out.println("<< Response: " + response.getStatusLine());
System.out.println(EntityUtils.toString(response.getEntity()));
System.out.println("==============");
if (!connStrategy.keepAlive(response, coreContext)) {
conn.close();
} else {
System.out.println("Connection kept alive...");
}
}
} finally {
conn.close();
}
}
}
httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java 0100644 0000000 0000000 00000012243 12613456022 031611 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.examples;
import java.io.ByteArrayInputStream;
import java.net.Socket;
import org.apache.http.ConnectionReuseStrategy;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.DefaultBHttpClientConnection;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.apache.http.protocol.HttpCoreContext;
import org.apache.http.protocol.HttpProcessor;
import org.apache.http.protocol.HttpProcessorBuilder;
import org.apache.http.protocol.HttpRequestExecutor;
import org.apache.http.protocol.RequestConnControl;
import org.apache.http.protocol.RequestContent;
import org.apache.http.protocol.RequestExpectContinue;
import org.apache.http.protocol.RequestTargetHost;
import org.apache.http.protocol.RequestUserAgent;
import org.apache.http.util.EntityUtils;
/**
* Elemental example for executing multiple POST requests sequentially.
*/
public class ElementalHttpPost {
public static void main(String[] args) throws Exception {
HttpProcessor httpproc = HttpProcessorBuilder.create()
.add(new RequestContent())
.add(new RequestTargetHost())
.add(new RequestConnControl())
.add(new RequestUserAgent("Test/1.1"))
.add(new RequestExpectContinue(true)).build();
HttpRequestExecutor httpexecutor = new HttpRequestExecutor();
HttpCoreContext coreContext = HttpCoreContext.create();
HttpHost host = new HttpHost("localhost", 8080);
coreContext.setTargetHost(host);
DefaultBHttpClientConnection conn = new DefaultBHttpClientConnection(8 * 1024);
ConnectionReuseStrategy connStrategy = DefaultConnectionReuseStrategy.INSTANCE;
try {
HttpEntity[] requestBodies = {
new StringEntity(
"This is the first test request",
ContentType.create("text/plain", Consts.UTF_8)),
new ByteArrayEntity(
"This is the second test request".getBytes(Consts.UTF_8),
ContentType.APPLICATION_OCTET_STREAM),
new InputStreamEntity(
new ByteArrayInputStream(
"This is the third test request (will be chunked)"
.getBytes(Consts.UTF_8)),
ContentType.APPLICATION_OCTET_STREAM)
};
for (int i = 0; i < requestBodies.length; i++) {
if (!conn.isOpen()) {
Socket socket = new Socket(host.getHostName(), host.getPort());
conn.bind(socket);
}
BasicHttpEntityEnclosingRequest request = new BasicHttpEntityEnclosingRequest("POST",
"/servlets-examples/servlet/RequestInfoExample");
request.setEntity(requestBodies[i]);
System.out.println(">> Request URI: " + request.getRequestLine().getUri());
httpexecutor.preProcess(request, httpproc, coreContext);
HttpResponse response = httpexecutor.execute(request, conn, coreContext);
httpexecutor.postProcess(response, httpproc, coreContext);
System.out.println("<< Response: " + response.getStatusLine());
System.out.println(EntityUtils.toString(response.getEntity()));
System.out.println("==============");
if (!connStrategy.keepAlive(response, coreContext)) {
conn.close();
} else {
System.out.println("Connection kept alive...");
}
}
} finally {
conn.close();
}
}
}
httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/HttpFileServer.java 0100644 0000000 0000000 00000016236 12613456022 031111 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.examples;
import java.io.File;
import java.io.IOException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import org.apache.http.ConnectionClosedException;
import org.apache.http.ExceptionLogger;
import org.apache.http.HttpConnection;
import org.apache.http.HttpEntity;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.MethodNotSupportedException;
import org.apache.http.config.SocketConfig;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.FileEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.bootstrap.HttpServer;
import org.apache.http.impl.bootstrap.ServerBootstrap;
import org.apache.http.protocol.HttpContext;
import org.apache.http.protocol.HttpCoreContext;
import org.apache.http.protocol.HttpRequestHandler;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.EntityUtils;
/**
* Embedded HTTP/1.1 file server based on a classic (blocking) I/O model.
*/
public class HttpFileServer {
public static void main(String[] args) throws Exception {
if (args.length < 1) {
System.err.println("Please specify document root directory");
System.exit(1);
}
// Document root directory
String docRoot = args[0];
int port = 8080;
if (args.length >= 2) {
port = Integer.parseInt(args[1]);
}
SSLContext sslcontext = null;
if (port == 8443) {
// Initialize SSL context
URL url = HttpFileServer.class.getResource("/my.keystore");
if (url == null) {
System.out.println("Keystore not found");
System.exit(1);
}
sslcontext = SSLContexts.custom()
.loadKeyMaterial(url, "secret".toCharArray(), "secret".toCharArray())
.build();
}
SocketConfig socketConfig = SocketConfig.custom()
.setSoTimeout(15000)
.setTcpNoDelay(true)
.build();
final HttpServer server = ServerBootstrap.bootstrap()
.setListenerPort(port)
.setServerInfo("Test/1.1")
.setSocketConfig(socketConfig)
.setSslContext(sslcontext)
.setExceptionLogger(new StdErrorExceptionLogger())
.registerHandler("*", new HttpFileHandler(docRoot))
.create();
server.start();
server.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
server.shutdown(5, TimeUnit.SECONDS);
}
});
}
static class StdErrorExceptionLogger implements ExceptionLogger {
@Override
public void log(final Exception ex) {
if (ex instanceof SocketTimeoutException) {
System.err.println("Connection timed out");
} else if (ex instanceof ConnectionClosedException) {
System.err.println(ex.getMessage());
} else {
ex.printStackTrace();
}
}
}
static class HttpFileHandler implements HttpRequestHandler {
private final String docRoot;
public HttpFileHandler(final String docRoot) {
super();
this.docRoot = docRoot;
}
public void handle(
final HttpRequest request,
final HttpResponse response,
final HttpContext context) throws HttpException, IOException {
String method = request.getRequestLine().getMethod().toUpperCase(Locale.ROOT);
if (!method.equals("GET") && !method.equals("HEAD") && !method.equals("POST")) {
throw new MethodNotSupportedException(method + " method not supported");
}
String target = request.getRequestLine().getUri();
if (request instanceof HttpEntityEnclosingRequest) {
HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity();
byte[] entityContent = EntityUtils.toByteArray(entity);
System.out.println("Incoming entity content (bytes): " + entityContent.length);
}
final File file = new File(this.docRoot, URLDecoder.decode(target, "UTF-8"));
if (!file.exists()) {
response.setStatusCode(HttpStatus.SC_NOT_FOUND);
StringEntity entity = new StringEntity(
"
File" + file.getPath() +
" not found
",
ContentType.create("text/html", "UTF-8"));
response.setEntity(entity);
System.out.println("File " + file.getPath() + " not found");
} else if (!file.canRead() || file.isDirectory()) {
response.setStatusCode(HttpStatus.SC_FORBIDDEN);
StringEntity entity = new StringEntity(
"
Access denied
",
ContentType.create("text/html", "UTF-8"));
response.setEntity(entity);
System.out.println("Cannot read file " + file.getPath());
} else {
HttpCoreContext coreContext = HttpCoreContext.adapt(context);
HttpConnection conn = coreContext.getConnection(HttpConnection.class);
response.setStatusCode(HttpStatus.SC_OK);
FileEntity body = new FileEntity(file, ContentType.create("text/html", (Charset) null));
response.setEntity(body);
System.out.println(conn + ": serving file " + file.getPath());
}
}
}
}
httpcomponents-core-4.4.4/httpcore/src/examples/org/apache/http/examples/PrintVersionInfo.java 0100644 0000000 0000000 00000005507 12613456022 031460 0 ustar 00 0000000 0000000 /*
* ====================================================================
* 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
* .
*
*/
package org.apache.http.examples;
import org.apache.http.util.VersionInfo;
/**
* Prints version information for debugging purposes.
* This can be used to verify that the correct versions of the
* HttpComponent JARs are picked up from the classpath.
*
*
*/
public class PrintVersionInfo {
/** A default list of module packages. */
private final static String[] MODULE_LIST = {
"org.apache.http", // HttpCore
"org.apache.http.nio", // HttpCore NIO
"org.apache.http.client", // HttpClient
};
/**
* Prints version information.
*
* @param args command line arguments. Leave empty to print version
* information for the default packages. Otherwise, pass
* a list of packages for which to get version info.
*/
public static void main(String args[]) {
String[] pckgs = (args.length > 0) ? args : MODULE_LIST;
VersionInfo[] via = VersionInfo.loadVersionInfo(pckgs, null);
System.out.println("version info for thread context classloader:");
for (int i=0; i