From 45a9f74407bd4fdee6b00343b2f060cb3307ab16 Mon Sep 17 00:00:00 2001 From: "arnett, stu" Date: Wed, 5 Aug 2015 14:55:56 -0500 Subject: [PATCH] v2.0.2 --- LICENSE-commons-codec.txt | 207 +++++++ LICENSE-httpclient.txt | 563 ++++++++++++++++++ LICENSE-httpcore.txt | 181 ++++++ LICENSE-jdom2.txt | 55 ++ LICENSE-jersey-apache-client4.txt | 140 +++++ LICENSE-jersey-client.txt | 140 +++++ LICENSE-jersey-core.txt | 140 +++++ LICENSE-log4j.txt | 207 +++++++ LICENSE-object-transform.txt | 30 + LICENSE-smart-client.txt | 30 + license.txt => LICENSE.txt | 6 + build.gradle | 10 +- .../com/emc/object/AbstractJerseyClient.java | 10 +- .../java/com/emc/object/EncryptionConfig.java | 11 + .../java/com/emc/object/ObjectConfig.java | 69 ++- src/main/java/com/emc/object/s3/S3Client.java | 163 ++++- src/main/java/com/emc/object/s3/S3Config.java | 104 +++- .../java/com/emc/object/s3/S3Constants.java | 7 + .../java/com/emc/object/s3/S3VHostConfig.java | 34 +- .../object/s3/jersey/AuthorizationFilter.java | 2 +- .../emc/object/s3/jersey/BucketFilter.java | 7 +- .../com/emc/object/s3/jersey/ErrorFilter.java | 27 +- .../emc/object/s3/jersey/NamespaceFilter.java | 3 +- .../emc/object/s3/jersey/S3JerseyClient.java | 110 +++- .../s3/request/AbstractBucketRequest.java | 1 + .../object/s3/request/CopyObjectRequest.java | 2 +- .../s3/request/CreateBucketRequest.java | 3 + .../java/com/emc/object/util/RestUtil.java | 27 + .../emc/object/s3/AbstractS3ClientTest.java | 5 +- .../com/emc/object/s3/GeoPinningTest.java | 2 +- .../com/emc/object/s3/S3AuthUtilTest.java | 2 +- .../com/emc/object/s3/S3JerseyClientTest.java | 253 +++++++- .../object/s3/S3JerseyUrlConnectionTest.java | 43 ++ 33 files changed, 2514 insertions(+), 80 deletions(-) create mode 100644 LICENSE-commons-codec.txt create mode 100644 LICENSE-httpclient.txt create mode 100644 LICENSE-httpcore.txt create mode 100644 LICENSE-jdom2.txt create mode 100644 LICENSE-jersey-apache-client4.txt create mode 100644 LICENSE-jersey-client.txt create mode 100644 LICENSE-jersey-core.txt create mode 100644 LICENSE-log4j.txt create mode 100644 LICENSE-object-transform.txt create mode 100644 LICENSE-smart-client.txt rename license.txt => LICENSE.txt (86%) mode change 100644 => 100755 src/main/java/com/emc/object/s3/S3Constants.java mode change 100644 => 100755 src/main/java/com/emc/object/s3/jersey/ErrorFilter.java mode change 100644 => 100755 src/test/java/com/emc/object/s3/S3JerseyClientTest.java create mode 100644 src/test/java/com/emc/object/s3/S3JerseyUrlConnectionTest.java diff --git a/LICENSE-commons-codec.txt b/LICENSE-commons-codec.txt new file mode 100644 index 00000000..7dfeaa1f --- /dev/null +++ b/LICENSE-commons-codec.txt @@ -0,0 +1,207 @@ +Library: commons-codec +Copyright 2002-2013 The Apache Software Foundation +License: Apache 2.0 +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + + 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 + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. diff --git a/LICENSE-httpclient.txt b/LICENSE-httpclient.txt new file mode 100644 index 00000000..eaf09ce1 --- /dev/null +++ b/LICENSE-httpclient.txt @@ -0,0 +1,563 @@ +Library: httpclient +Copyright 1999-2015 The Apache Software Foundation +License: Apache 2.0 +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + 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 includes Public Suffix List copied from + +licensed under the terms of the Mozilla Public License, v. 2.0 + +Full license text: + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. \ No newline at end of file diff --git a/LICENSE-httpcore.txt b/LICENSE-httpcore.txt new file mode 100644 index 00000000..8b6e6659 --- /dev/null +++ b/LICENSE-httpcore.txt @@ -0,0 +1,181 @@ +Library: httpcore +Copyright 2006-2009 The Apache Software Foundation +License: Apache 2.0 +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + 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 \ No newline at end of file diff --git a/LICENSE-jdom2.txt b/LICENSE-jdom2.txt new file mode 100644 index 00000000..8732c70b --- /dev/null +++ b/LICENSE-jdom2.txt @@ -0,0 +1,55 @@ +Library: jdom2 +Copyright (C) 2000-2012 Jason Hunter & Brett McLaughlin +License: Apache - Modified +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + + Copyright (C) 2000-2012 Jason Hunter & Brett McLaughlin. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions, and the disclaimer that follows + these conditions in the documentation and/or other materials + provided with the distribution. + + 3. The name "JDOM" must not be used to endorse or promote products + derived from this software without prior written permission. For + written permission, please contact . + + 4. Products derived from this software may not be called "JDOM", nor + may "JDOM" appear in their name, without prior written permission + from the JDOM Project Management . + + In addition, we request (but do not require) that you include in the + end-user documentation provided with the redistribution and/or in the + software itself an acknowledgement equivalent to the following: + "This product includes software developed by the + JDOM Project (http://www.jdom.org/)." + Alternatively, the acknowledgment may be graphical using the logos + available at http://www.jdom.org/images/logos. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + + This software consists of voluntary contributions made by many + individuals on behalf of the JDOM Project and was originally + created by Jason Hunter and + Brett McLaughlin . For more information + on the JDOM Project, please see . diff --git a/LICENSE-jersey-apache-client4.txt b/LICENSE-jersey-apache-client4.txt new file mode 100644 index 00000000..419c290e --- /dev/null +++ b/LICENSE-jersey-apache-client4.txt @@ -0,0 +1,140 @@ +Library: jersey-apache-client4 +Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. +License: CDDL +Full License Text: +----------------------------------------------------------------------------------------------------------------------- +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)Version 1.1 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable form of any of the following: + + A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + B. Any new file that contains any part of the Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + + 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + +---------- +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) +The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. diff --git a/LICENSE-jersey-client.txt b/LICENSE-jersey-client.txt new file mode 100644 index 00000000..92e51976 --- /dev/null +++ b/LICENSE-jersey-client.txt @@ -0,0 +1,140 @@ +Library: jersey-client +Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. +License: CDDL +Full License Text: +----------------------------------------------------------------------------------------------------------------------- +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)Version 1.1 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable form of any of the following: + + A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + B. Any new file that contains any part of the Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + + 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + +---------- +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) +The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. diff --git a/LICENSE-jersey-core.txt b/LICENSE-jersey-core.txt new file mode 100644 index 00000000..c07716a9 --- /dev/null +++ b/LICENSE-jersey-core.txt @@ -0,0 +1,140 @@ +Library: jersey-core +Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved. +License: CDDL +Full License Text: +----------------------------------------------------------------------------------------------------------------------- +COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)Version 1.1 + +1. Definitions. + + 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. + + 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. + + 1.4. "Executable" means the Covered Software in any form other than Source Code. + + 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. + + 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. + + 1.7. "License" means this document. + + 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means the Source Code and Executable form of any of the following: + + A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; + + B. Any new file that contains any part of the Original Software or previous Modification; or + + C. Any new file that is contributed or otherwise made available under the terms of this License. + + 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. + + 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. + + 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. + + 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. + +2. License Grants. + + 2.1. The Initial Developer Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). + + (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. + + 2.2. Contributor Grant. + + Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: + + (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). + + (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. + + (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + + 3.1. Availability of Source Code. + + Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. + + 3.2. Modifications. + + The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. + + 3.3. Required Notices. + + You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. + + 3.4. Application of Additional Terms. + + You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. + + 3.5. Distribution of Executable Versions. + + You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. + + 3.6. Larger Works. + + You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. + +4. Versions of the License. + + 4.1. New Versions. + + Oracle is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. + + 4.2. Effect of New Versions. + + You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. + + 4.3. Modified Versions. + + When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. + +5. DISCLAIMER OF WARRANTY. + + COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +6. TERMINATION. + + 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. + + 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. + + 6.3. If You assert a patent infringement claim against Participant alleging that the Participant Software directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. + + 6.4. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. + +7. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +8. U.S. GOVERNMENT END USERS. + + The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. ? 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. + +9. MISCELLANEOUS. + + This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. + +10. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. + +---------- +NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) +The code released under the CDDL shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. diff --git a/LICENSE-log4j.txt b/LICENSE-log4j.txt new file mode 100644 index 00000000..c418da88 --- /dev/null +++ b/LICENSE-log4j.txt @@ -0,0 +1,207 @@ +Library: log4j +Copyright 1999-2005 The Apache Software Foundation +License: Apache 2.0 +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + + 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 + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 1999-2005 The Apache Software Foundation + + Licensed 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. diff --git a/LICENSE-object-transform.txt b/LICENSE-object-transform.txt new file mode 100644 index 00000000..5f494f41 --- /dev/null +++ b/LICENSE-object-transform.txt @@ -0,0 +1,30 @@ +Library: object-transform +Copyright (c) 2015, EMC Corporation. +License: BSD 3-clause +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + +Copyright (c) 2015, EMC Corporation. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + ++ Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. ++ Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. ++ The name of EMC Corporation may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSE-smart-client.txt b/LICENSE-smart-client.txt new file mode 100644 index 00000000..95181c43 --- /dev/null +++ b/LICENSE-smart-client.txt @@ -0,0 +1,30 @@ +Library: smart-client +Copyright (c) 2015, EMC Corporation. +License: BSD 3-clause +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + +Copyright (c) 2015, EMC Corporation. +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + + Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + The name of EMC Corporation may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/license.txt b/LICENSE.txt similarity index 86% rename from license.txt rename to LICENSE.txt index 57563a39..f91d8982 100644 --- a/license.txt +++ b/LICENSE.txt @@ -1,3 +1,9 @@ +Library: object-client +Copyright (c) 2015, EMC Corporation. +License: BSD 3-clause +Full License Text: +----------------------------------------------------------------------------------------------------------------------- + Copyright (c) 2015, EMC Corporation. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/build.gradle b/build.gradle index 62f2c5ad..70531be4 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ description = 'EMC Object Client for Java - provides REST access to object data ext.githubProjectName = 'ecs-object-client-java' buildscript { - ext.commonBuildVersion = '1.3.1' + ext.commonBuildVersion = '1.3.2' ext.commonBuildDir = "https://raw.githubusercontent.com/emcvipr/ecs-common-build/v$commonBuildVersion" apply from: "$commonBuildDir/ecs-publish.buildscript.gradle", to: buildscript } @@ -37,8 +37,8 @@ buildscript { apply from: "$commonBuildDir/ecs-publish.gradle" dependencies { - compile 'com.emc.ecs:smart-client:2.0.1', - 'com.emc.ecs:object-transform:1.0.1', - 'org.jdom:jdom2:2.0.5' - testCompile 'junit:junit:4.11' + compile 'com.emc.ecs:smart-client:2.0.2', + 'com.emc.ecs:object-transform:1.0.2', + 'org.jdom:jdom2:2.0.6' + testCompile 'junit:junit:4.12' } diff --git a/src/main/java/com/emc/object/AbstractJerseyClient.java b/src/main/java/com/emc/object/AbstractJerseyClient.java index daec7735..9ae82a88 100644 --- a/src/main/java/com/emc/object/AbstractJerseyClient.java +++ b/src/main/java/com/emc/object/AbstractJerseyClient.java @@ -32,17 +32,11 @@ import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.WebResource; import com.sun.jersey.client.apache4.config.ApacheHttpClient4Config; -import org.apache.log4j.Logger; -import java.lang.annotation.Annotation; import java.net.URI; import java.util.Map; public abstract class AbstractJerseyClient { - private static final Logger l4j = Logger.getLogger(AbstractJerseyClient.class); - - protected static final Annotation[] EMPTY_ANNOTATIONS = new Annotation[0]; - protected ObjectConfig objectConfig; protected AbstractJerseyClient(ObjectConfig objectConfig) { @@ -145,4 +139,8 @@ protected WebResource.Builder buildRequest(Client client, ObjectRequest request) return builder; } + + public ObjectConfig getObjectConfig() { + return objectConfig; + } } diff --git a/src/main/java/com/emc/object/EncryptionConfig.java b/src/main/java/com/emc/object/EncryptionConfig.java index 7e4a6389..d149143d 100644 --- a/src/main/java/com/emc/object/EncryptionConfig.java +++ b/src/main/java/com/emc/object/EncryptionConfig.java @@ -43,6 +43,7 @@ * {@link KeyProvider} as well. */ public class EncryptionConfig { + // NOTE: if you add a property, make sure you add it to the cloning constructor! private String encryptionSpec = new EncryptionCodec().getDefaultEncodeSpec(); private boolean compressionEnabled = false; private String compressionSpec = new DeflateCodec().getDefaultEncodeSpec(); @@ -82,6 +83,16 @@ public EncryptionConfig(KeyProvider keyProvider) { codecProperties.put(EncryptionCodec.PROP_KEY_PROVIDER, keyProvider); } + /** + * Cloning constructor. + */ + public EncryptionConfig(EncryptionConfig other) { + this.encryptionSpec = other.encryptionSpec; + this.compressionEnabled = other.compressionEnabled; + this.compressionSpec = other.compressionSpec; + this.codecProperties = new HashMap(codecProperties); + } + public KeyProvider getKeyProvider() { return EncryptionCodec.getKeyProvider(codecProperties); } diff --git a/src/main/java/com/emc/object/ObjectConfig.java b/src/main/java/com/emc/object/ObjectConfig.java index 77247f3d..ffcb3e4d 100644 --- a/src/main/java/com/emc/object/ObjectConfig.java +++ b/src/main/java/com/emc/object/ObjectConfig.java @@ -26,6 +26,7 @@ */ package com.emc.object; +import com.emc.object.util.RestUtil; import com.emc.rest.smart.Host; import com.emc.rest.smart.SmartConfig; import com.emc.rest.smart.ecs.Vdc; @@ -52,9 +53,11 @@ public abstract class ObjectConfig> { (PACKAGE_VERSION != null ? " v" + PACKAGE_VERSION : ""), System.getProperty("java.version"), System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch")); + // NOTE: if you add a property, make sure you add it to the cloning constructor! private Protocol protocol; private List vdcs; private int port = -1; + private boolean smartClient = true; private String rootContext; private String namespace; private String identity; @@ -67,7 +70,15 @@ public abstract class ObjectConfig> { private Map properties = new HashMap(); /** - * Single VDC or virtual host constructor. + * Single endpoint constructor (disables smart-client). + */ + public ObjectConfig(URI endpoint) { + this(Protocol.valueOf(endpoint.getScheme().toUpperCase()), endpoint.getPort(), endpoint.getHost()); + setSmartClient(false); + } + + /** + * Single VDC constructor. */ public ObjectConfig(Protocol protocol, int port, String... hosts) { this(protocol, port, new Vdc(hosts)); @@ -82,6 +93,28 @@ public ObjectConfig(Protocol protocol, int port, Vdc... vdcs) { this.vdcs = Arrays.asList(vdcs); } + /** + * Cloning constructor. + */ + public ObjectConfig(ObjectConfig other) { + this.protocol = other.protocol; + // deep copy the VDCs to avoid two clients referencing the same host lists (SDK-122) + this.vdcs = new ArrayList(); + for (Vdc vdc : other.getVdcs()) { + this.vdcs.add(new Vdc(vdc.getName(), vdc.getHosts())); + } + this.port = other.port; + this.smartClient = other.smartClient; + this.rootContext = other.rootContext; + this.namespace = other.namespace; + this.identity = other.identity; + this.secretKey = other.secretKey; + this.serverClockSkew = other.serverClockSkew; + this.userAgent = other.userAgent; + if (other.encryptionConfig != null) this.encryptionConfig = new EncryptionConfig(other.encryptionConfig); + this.geoPinningEnabled = other.geoPinningEnabled; + } + public abstract Host resolveHost(); /** @@ -101,7 +134,7 @@ public URI resolvePath(String relativePath, String query) { path += relativePath; try { - URI uri = new URI(protocol.toString(), null, resolveHost().getName(), port, path, query, null); + URI uri = RestUtil.buildUri(protocol.toString().toLowerCase(), resolveHost().getName(), port, path, query, null); l4j.debug("raw path & query: " + path + "?" + query); l4j.debug("resolved URI: " + uri); @@ -121,8 +154,10 @@ public SmartConfig toSmartConfig() { SmartConfig smartConfig = new SmartConfig(allHosts); - smartConfig.setHealthCheckEnabled(!Boolean.parseBoolean(propAsString(properties, PROPERTY_DISABLE_HEALTH_CHECK))); - smartConfig.setHostUpdateEnabled(!Boolean.parseBoolean(propAsString(properties, PROPERTY_DISABLE_HOST_UPDATE))); + if (!smartClient || Boolean.parseBoolean(propAsString(properties, PROPERTY_DISABLE_HEALTH_CHECK))) + smartConfig.setHealthCheckEnabled(false); + if (!smartClient || Boolean.parseBoolean(propAsString(properties, PROPERTY_DISABLE_HOST_UPDATE))) + smartConfig.setHostUpdateEnabled(false); if (properties.containsKey(PROPERTY_POLL_INTERVAL)) { try { @@ -166,6 +201,18 @@ public int getPort() { return port; } + public void setPort(int port) { + this.port = port; + } + + public boolean isSmartClient() { + return smartClient; + } + + public void setSmartClient(boolean smartClient) { + this.smartClient = smartClient; + } + public String getRootContext() { return rootContext; } @@ -255,6 +302,18 @@ public void setProperty(String propName, Object value) { properties.put(propName, value); } + @SuppressWarnings("unchecked") + public T withPort(int port) { + setPort(port); + return (T) this; + } + + @SuppressWarnings("unchecked") + public T withSmartClient(boolean smartClient) { + setSmartClient(smartClient); + return (T) this; + } + @SuppressWarnings("unchecked") public T withRootContext(String rootContext) { setRootContext(rootContext); @@ -309,6 +368,7 @@ public String toString() { "protocol=" + protocol + ", vdcs=" + vdcs + ", port=" + port + + ", smartClient=" + smartClient + ", rootContext='" + rootContext + '\'' + ", namespace='" + namespace + '\'' + ", identity='" + identity + '\'' + @@ -316,6 +376,7 @@ public String toString() { ", serverClockSkew=" + serverClockSkew + ", userAgent='" + userAgent + '\'' + ", encryptionConfig=" + encryptionConfig + + ", geoPinningEnabled=" + geoPinningEnabled + ", properties=" + properties + '}'; } diff --git a/src/main/java/com/emc/object/s3/S3Client.java b/src/main/java/com/emc/object/s3/S3Client.java index 6acda8aa..b91499a9 100644 --- a/src/main/java/com/emc/object/s3/S3Client.java +++ b/src/main/java/com/emc/object/s3/S3Client.java @@ -39,7 +39,7 @@ * ECS does not implement all S3 operations in the API specification. Some methods have yet to be implemented, while * many do not apply to a private cloud infrastructure. ECS also extends the S3 API by providing methods not included * in the original specification, such as mutable objects (byte-range update) and atomic appends (returning offset). - *

+ *

* Any calls resulting in an error will throw S3Exception. All available information from the error will be included in * the exception instance. If an exception is not thrown, you may assume the call was successful. */ @@ -50,103 +50,254 @@ public interface S3Client { */ void shutdown(); + /** + * Lists all of the data nodes in the current VDC + */ ListDataNode listDataNodes(); /** - * Lists the buckets owned by the user. + * Lists the buckets owned by the user */ ListBucketsResult listBuckets(); /** - * List the buckets owned by the user. ListBucketsRequest provides all available options for this call. + * List the buckets owned by the user using the parameters specified in request */ ListBucketsResult listBuckets(ListBucketsRequest request); /** - * Returns whether a bucket exists in the user's namespace (or the configured namespace of the client). This call - * will return true if the bucket exists even if the user does not have access to the bucket. If this call returns - * false, a subsequent call to createBucket with the same name should succeed. + * Returns whether bucketName exists in the user's namespace (or the configured namespace of the + * client). This call will return true if the bucket exists even if the user does not have access to the bucket. If + * this call returns false, a subsequent call to createBucket with the same name should succeed */ boolean bucketExists(String bucketName); + /** + * Creates a bucket with the specified name in the default namespace and with the default replication group + */ void createBucket(String bucketName); + /** + * Creates a bucket using the parameters specified in request + * + * @see CreateBucketRequest + */ void createBucket(CreateBucketRequest request); + /** + * Deletes bucketName. The bucket must be empty of all objects and versions before it can be deleted + */ void deleteBucket(String bucketName); + /** + * Sets the specified ACL on bucketName + * + * @see AccessControlList + */ void setBucketAcl(String bucketName, AccessControlList acl); + /** + * Sets the specified canned ACL on bucketName + * + * @see CannedAcl + */ void setBucketAcl(String bucketName, CannedAcl cannedAcl); + /** + * Sets the ACL of a bucket using parameters in request + * + * @see SetBucketAclRequest + */ void setBucketAcl(SetBucketAclRequest request); + /** + * Retrieves the ACL of bucketName + * + * @see AccessControlList + */ AccessControlList getBucketAcl(String bucketName); + /** + * Sets the CORS configuration for bucketName + * + * @see CorsConfiguration + */ void setBucketCors(String bucketName, CorsConfiguration corsConfiguration); + /** + * Retrieves the CORS configuration for bucketName + * + * @see CorsConfiguration + */ CorsConfiguration getBucketCors(String bucketName); + /** + * Removes the CORS configuration for bucketName + */ void deleteBucketCors(String bucketName); + /** + * Sets the lifecycle configuration for bucketName + * + * @see LifecycleConfiguration + */ void setBucketLifecycle(String bucketName, LifecycleConfiguration lifecycleConfiguration); + /** + * Retrieves the lifecycle configuration for bucketName + * + * @see LifecycleConfiguration + */ LifecycleConfiguration getBucketLifecycle(String bucketName); + /** + * Deletes the lifecycle configuration for bucketName + */ void deleteBucketLifecycle(String bucketName); + /** + * Gets the location of bucketName. This call will return the name of the primary VDC of the bucket + */ LocationConstraint getBucketLocation(String bucketName); + /** + * Enables or suspends versioning on bucketName + */ void setBucketVersioning(String bucketName, VersioningConfiguration versioningConfiguration); + /** + * Retrieves the versioning status of bucketName (none, enabled or suspended) + */ VersioningConfiguration getBucketVersioning(String bucketName); + /** + * Lists all objects in bucketName with no restrictions + */ ListObjectsResult listObjects(String bucketName); + /** + * Lists objects in bucketName that start with prefix + */ ListObjectsResult listObjects(String bucketName, String prefix); + /** + * Lists objects in a bucket using parameters specified in request + */ ListObjectsResult listObjects(ListObjectsRequest request); + /** + * Lists all versions of all objects in bucketName that start with prefix + */ ListVersionsResult listVersions(String bucketName, String prefix); + /** + * Lists all versions of all objects in a bucket using the parameters specified in request + */ ListVersionsResult listVersions(ListVersionsRequest request); + /** + * Creates or overwrites an object in bucketName named key containing content + * and having contentType + */ void putObject(String bucketName, String key, Object content, String contentType); + /** + * Updates object key in bucket bucketName at the specified byte range with + * new content + */ void putObject(String bucketName, String key, Range range, Object content); + /** + * Creates or updates an object using the parameters specified in request + */ PutObjectResult putObject(PutObjectRequest request); + /** + * Atomically appends to the end of object key in bucket bucketName with + * content and returns the starting offset of the append operation + */ long appendObject(String bucketName, String key, Object content); + /** + * Remotely copies object sourceKey in bucket sourceBucketName to key in + * bucketName + */ CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String bucketName, String key); + /** + * Remotely copies an object using the parameters specified in request + */ CopyObjectResult copyObject(CopyObjectRequest request); + /** + * Reads object key in bucket bucketName and converts it to objectType, + * provided the conversion is supported by the implementation + */ T readObject(String bucketName, String key, Class objectType); + /** + * Reads version versionId of object key in bucket bucketName and converts + * it to objectType, provided the conversion is supported by the implementation + */ T readObject(String bucketName, String key, String versionId, Class objectType); + /** + * Reads range bytes of object key in bucket bucketName as a stream + */ InputStream readObjectStream(String bucketName, String key, Range range); + /** + * Gets object key in bucket bucketName. Object details as well as the data stream + * (obtained from {@link GetObjectResult#getObject()} are contained in the {@link GetObjectResult} instance + */ GetObjectResult getObject(String bucketName, String key); + /** + * Gets an object using the parameters specified in request. Object details as well as the translated + * data (converted to objectType) are contained in the {@link GetObjectResult} instance + */ GetObjectResult getObject(GetObjectRequest request, Class objectType); + /** + * Generates a pre-signed URL to read object key in bucket bucketName. The URL will be + * valid until expirationTime + */ URL getPresignedUrl(String bucketName, String key, Date expirationTime); + /** + * Generates a pre-signed URL using the parameters specified in request + */ URL getPresignedUrl(PresignedUrlRequest request); + /** + * Deletes object key from bucket bucketName + */ void deleteObject(String bucketName, String key); + /** + * Delets version versionId of object key in bucket bucketName. NOTE: + * versioning must be enabled in the bucket + */ void deleteVersion(String bucketName, String key, String versionId); + /** + * Deletes objects using the parameters specified in request + */ DeleteObjectsResult deleteObjects(DeleteObjectsRequest request); + /** + * Sets metadata on object key in bucket bucketName + */ void setObjectMetadata(String bucketName, String key, S3ObjectMetadata objectMetadata); + /** + * Gets metadata for object key in bucket bucketName + */ S3ObjectMetadata getObjectMetadata(String bucketName, String key); + /** + * Gets metadata using the parameters specified in request + */ S3ObjectMetadata getObjectMetadata(GetObjectMetadataRequest request); void setObjectAcl(String bucketName, String key, AccessControlList acl); diff --git a/src/main/java/com/emc/object/s3/S3Config.java b/src/main/java/com/emc/object/s3/S3Config.java index 7383c1c2..669c5882 100644 --- a/src/main/java/com/emc/object/s3/S3Config.java +++ b/src/main/java/com/emc/object/s3/S3Config.java @@ -31,10 +31,32 @@ import com.emc.rest.smart.Host; import com.emc.rest.smart.ecs.Vdc; +import java.net.URI; + /** - * By default, the smart client is enabled, which means virtual host-style buckets/namespaces cannot be used. To use - * virtual host-style requests, construct an {@link S3VHostConfig} instead. That will disable the smart - * client and set a single host endpoint, prepending namespaces and buckets as appropriate. + * To enable the smart-client with a single VDC, use the {@link #S3Config(Protocol, String...)} constructor: + *

+ *     S3Config s3Config = new S3Config(Protocol.HTTP, "10.10.10.11", "10.10.10.12");
+ * 
+ *

+ * To enable the smart-client with multiple VDCs, use the {@link #S3Config(Protocol, Vdc...)} constructor: + *

+ *     S3Config s3Config = new S3Config(Protocol.HTTP, new Vdc("10.10.10.11", "10.10.10.12"), new Vdc("10.20.10.11", "10.20.10.12"));
+ * 
+ *

+ * To use an external load balancer without virtual-host-style requests use the {@link #S3Config(URI)} constructor: + *

+ *     S3Config s3Config = new S3Config("https://10.10.10.10:8443");
+ * 
+ *

+ * To use an external load balancer with virtual-host-style requests (where bucket.namespace. is + * prepended to the hostname), use the {@link #S3Config(URI)} constructor and {@link #setUseVHost(boolean)} to true: + *

+ *     S3Config s3Config = new S3Config("https://s3.company.com").withUseVHost(true);
+ * 
+ *

+ * NOTE: If you enable virtual-host-style requests, you must specify your namespace or set it to null and + * include it in the hostname of the endpoint. */ public class S3Config extends ObjectConfig { public static final int DEFAULT_HTTP_PORT = 9020; @@ -46,25 +68,43 @@ protected static int defaultPort(Protocol protocol) { throw new IllegalArgumentException("unknown protocol: " + protocol); } + // NOTE: if you add a property, make sure you add it to the cloning constructor! protected boolean useVHost = false; protected boolean signNamespace = true; + protected boolean checksumEnabled = true; /** - * Single VDC constructor. + * External load balancer constructor (no smart-client). + *

+ * NOTE: To use virtual-host-style requests where + * bucket.namespace. is prepended to the host, you must {@link #setUseVHost(boolean)} to true. + */ + public S3Config(URI endpoint) { + super(endpoint); + } + + /** + * Single VDC smart-client constructor. */ public S3Config(Protocol protocol, String... hostList) { super(protocol, defaultPort(protocol), hostList); } /** - * Multiple VDC constructor. + * Multiple VDC smart-client constructor. */ public S3Config(Protocol protocol, Vdc... vdcs) { - this(protocol, defaultPort(protocol), vdcs); + super(protocol, defaultPort(protocol), vdcs); } - public S3Config(Protocol protocol, int port, Vdc... vdcs) { - super(protocol, port, vdcs); + /** + * Cloning constructor. + */ + public S3Config(S3Config other) { + super(other); + this.useVHost = other.useVHost; + this.signNamespace = other.signNamespace; + this.checksumEnabled = other.checksumEnabled; } @Override @@ -76,10 +116,58 @@ public boolean isUseVHost() { return useVHost; } + /** + * Set to true to enable virtual-host-style requests. This prepends namespaces and buckets as appropriate + * for each request. + *

+ * NOTE: To use virtual host configuration, you must disable the smart client by using the + * {@link #S3Config(URI)} constructor. You must also specify your namespace or set it to null and include + * it in the hostname of the endpoint. + */ + public void setUseVHost(boolean useVHost) { + this.useVHost = useVHost; + } + public boolean isSignNamespace() { return signNamespace; } + /** + * Standard ECS configurations require signing the namespace to support cross-namespace + * requests. To change this behavior to a legacy type virtual host, + * which is isolated to the default namespace of the user, set this to false. + */ + public void setSignNamespace(boolean signNamespace) { + this.signNamespace = signNamespace; + } + + public boolean isChecksumEnabled() { + return checksumEnabled; + } + + /** + * By default, MD5 sums are verified on whole-object reads and writes whenever possible. You can disable that by + * setting this to false. + */ + public void setChecksumEnabled(boolean checksumEnabled) { + this.checksumEnabled = checksumEnabled; + } + + public S3Config withUseVHost(boolean useVHost) { + setUseVHost(useVHost); + return this; + } + + public S3Config withSignNamespace(boolean signNamespace) { + setSignNamespace(signNamespace); + return this; + } + + public S3Config withChecksumEnabled(boolean checksumEnabled) { + setChecksumEnabled(checksumEnabled); + return this; + } + @Override public String toString() { return "S3Config{" + diff --git a/src/main/java/com/emc/object/s3/S3Constants.java b/src/main/java/com/emc/object/s3/S3Constants.java old mode 100644 new mode 100755 index 9541e74c..9c3723fc --- a/src/main/java/com/emc/object/s3/S3Constants.java +++ b/src/main/java/com/emc/object/s3/S3Constants.java @@ -78,6 +78,13 @@ public final class S3Constants { public static final String PROPERTY_BUCKET_NAME = "com.emc.object.s3.bucketName"; + public static final String ERROR_NO_SUCH_KEY = "NoSuchKey"; + public static final String ERROR_NO_SUCH_BUCKET = "NoSuchBucket"; + public static final String ERROR_NO_ACCESS_DENIED = "AccessDenied"; + public static final String ERROR_INTERNAL = "InternalError"; + public static final String ERROR_INVALID_ARGUMENT = "InvalidArgument"; + public static final String ERROR_METHOD_NOT_ALLOWED = "MethodNotAllowed"; + private S3Constants() { } } diff --git a/src/main/java/com/emc/object/s3/S3VHostConfig.java b/src/main/java/com/emc/object/s3/S3VHostConfig.java index 335c609b..edfe686d 100644 --- a/src/main/java/com/emc/object/s3/S3VHostConfig.java +++ b/src/main/java/com/emc/object/s3/S3VHostConfig.java @@ -26,43 +26,15 @@ */ package com.emc.object.s3; -import com.emc.object.ObjectConfig; -import com.emc.object.Protocol; -import com.emc.rest.smart.ecs.Vdc; - import java.net.URI; /** - * This configuration uses a single named host as the endpoint and prepends namespaces and buckets as appropriate - * for each request. Standard virtual host configurations require signing the namespace to support cross-namespace - * requests. This is the default behavior of this configuration. To change this behavior to a legacy type virtual host - * which is isolated to the default namespace of the user, call {@link #setLegacyMode(boolean)} and pass - * true as the argument. - *

- * NOTE: To use virtual host configuration, you must specify your namespace or set it to null and include it - * in the hostname of the endpoint. + * @deprecated (2.0.2) use {@link S3Config#S3Config(URI)} and {@link S3Config#setUseVHost(boolean)} to true. */ public class S3VHostConfig extends S3Config { public S3VHostConfig(URI endpoint) { - super(Protocol.valueOf(endpoint.getScheme().toUpperCase()), endpoint.getPort(), new Vdc(endpoint.getHost())); - - // standard VHost type signs namespace - useVHost = true; - signNamespace = true; - - // make sure we disable "smart" features - setProperty(ObjectConfig.PROPERTY_DISABLE_HOST_UPDATE, "true"); - setProperty(ObjectConfig.PROPERTY_DISABLE_HEALTH_CHECK, "true"); - } - - /** - * Set to true to enable legacy S3 behavior where each request is isolated to the default namespace of the user. - */ - public void setLegacyMode(boolean legacyMode) { - signNamespace = !legacyMode; - } + super(endpoint); - public boolean isLegacyMode() { - return !signNamespace; + setUseVHost(true); } } diff --git a/src/main/java/com/emc/object/s3/jersey/AuthorizationFilter.java b/src/main/java/com/emc/object/s3/jersey/AuthorizationFilter.java index eddc1d80..7e066573 100644 --- a/src/main/java/com/emc/object/s3/jersey/AuthorizationFilter.java +++ b/src/main/java/com/emc/object/s3/jersey/AuthorizationFilter.java @@ -54,7 +54,7 @@ public ClientResponse handle(ClientRequest request) throws ClientHandlerExceptio // if no identity is provided, this is an anonymous client if (s3Config.getIdentity() != null) { Map parameters = RestUtil.getQueryParameterMap(request.getURI().getQuery()); - String resource = request.getURI().getPath(); + String resource = RestUtil.getEncodedPath(request.getURI()); // check if bucket is in hostname if (s3Config.isUseVHost()) { diff --git a/src/main/java/com/emc/object/s3/jersey/BucketFilter.java b/src/main/java/com/emc/object/s3/jersey/BucketFilter.java index e5cc19f0..1bde2ffa 100644 --- a/src/main/java/com/emc/object/s3/jersey/BucketFilter.java +++ b/src/main/java/com/emc/object/s3/jersey/BucketFilter.java @@ -28,6 +28,7 @@ import com.emc.object.s3.S3Config; import com.emc.object.s3.S3Constants; +import com.emc.object.util.RestUtil; import com.sun.jersey.api.client.ClientHandlerException; import com.sun.jersey.api.client.ClientRequest; import com.sun.jersey.api.client.ClientResponse; @@ -44,13 +45,11 @@ public static URI insertBucket(URI uri, String bucketName, boolean useVHost) { try { if (useVHost) { // prepend to hostname (i.e. bucket.s3.company.com) String hostname = bucketName + "." + uri.getHost(); - uri = new URI(uri.getScheme(), uri.getUserInfo(), hostname, uri.getPort(), - uri.getPath(), uri.getQuery(), uri.getFragment()); + uri = RestUtil.replaceHost(uri, hostname); } else { // prepend to resource path (i.e. s3.company.com/bucket) String resource = "/" + bucketName + uri.getPath(); - uri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), - resource, uri.getQuery(), uri.getFragment()); + uri = RestUtil.replacePath(uri, resource); } l4j.debug("URI including bucket: " + uri); diff --git a/src/main/java/com/emc/object/s3/jersey/ErrorFilter.java b/src/main/java/com/emc/object/s3/jersey/ErrorFilter.java old mode 100644 new mode 100755 index 3a1b41bf..f4960b8f --- a/src/main/java/com/emc/object/s3/jersey/ErrorFilter.java +++ b/src/main/java/com/emc/object/s3/jersey/ErrorFilter.java @@ -38,6 +38,7 @@ import org.jdom2.Namespace; import org.jdom2.input.SAXBuilder; +import javax.ws.rs.core.Response; import java.io.InputStreamReader; import java.io.Reader; @@ -48,12 +49,36 @@ public ClientResponse handle(ClientRequest request) throws ClientHandlerExceptio ClientResponse response = getNext().handle(request); if (response.getStatus() > 299) { - throw parseErrorResponse(new InputStreamReader(response.getEntityInputStream()), response.getStatus()); + if(response.hasEntity()) { + throw parseErrorResponse(new InputStreamReader(response.getEntityInputStream()), response.getStatus()); + } else { + // No response entity. Don't try to parse it. + Response.StatusType st = response.getStatusInfo(); + throw new S3Exception(st.getReasonPhrase(), st.getStatusCode(), guessStatus(st.getStatusCode()), + response.getHeaders().getFirst("x-amz-request-id")); + } } return response; } + private String guessStatus(int statusCode) { + switch (statusCode) { + case 400: + return S3Constants.ERROR_INVALID_ARGUMENT; + case 403: + return S3Constants.ERROR_NO_ACCESS_DENIED; + case 404: + return S3Constants.ERROR_NO_SUCH_KEY; + case 405: + return S3Constants.ERROR_METHOD_NOT_ALLOWED; + case 500: + return S3Constants.ERROR_INTERNAL; + default: + return ""; + } + } + public static S3Exception parseErrorResponse(Reader reader, int statusCode) { // JAXB will expect a namespace if we try to unmarshall, but some error responses don't include diff --git a/src/main/java/com/emc/object/s3/jersey/NamespaceFilter.java b/src/main/java/com/emc/object/s3/jersey/NamespaceFilter.java index 2039ec11..70a57b4e 100644 --- a/src/main/java/com/emc/object/s3/jersey/NamespaceFilter.java +++ b/src/main/java/com/emc/object/s3/jersey/NamespaceFilter.java @@ -47,8 +47,7 @@ public static URI insertNamespace(URI uri, String namespace) { try { String hostname = namespace + "." + uri.getHost(); l4j.debug(String.format("hostname including namespace: %s", hostname)); - return new URI(uri.getScheme(), uri.getUserInfo(), hostname, uri.getPort(), - uri.getPath(), uri.getQuery(), uri.getFragment()); + return RestUtil.replaceHost(uri, hostname); } catch (URISyntaxException e) { throw new RuntimeException(String.format("namespace \"%s\" generated an invalid URI", namespace), e); } diff --git a/src/main/java/com/emc/object/s3/jersey/S3JerseyClient.java b/src/main/java/com/emc/object/s3/jersey/S3JerseyClient.java index f7a33fe6..a1e93ba6 100644 --- a/src/main/java/com/emc/object/s3/jersey/S3JerseyClient.java +++ b/src/main/java/com/emc/object/s3/jersey/S3JerseyClient.java @@ -40,6 +40,7 @@ import com.emc.rest.smart.SmartConfig; import com.emc.rest.smart.ecs.EcsHostListProvider; import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientHandler; import com.sun.jersey.api.client.ClientHandlerException; import com.sun.jersey.api.client.ClientResponse; import org.apache.log4j.Logger; @@ -49,6 +50,81 @@ import java.net.URL; import java.util.Date; +/** + * Reference implementation of S3Client. + *

+ * This implementation uses the JAX-RS reference implementation (Jersey) as it's REST client. When sending or + * receiving data, the following content handlers are supported by default. Be sure to use the appropriate content-type + * associated with each object type or the handlers will not understand the request. + *

+ * + * + * + * + * + * + * + *
Object Type (class)Expected Content-Type(s)
byte[]*any*
java.lang.String*any*
java.io.File (send-only)*any*
java.io.InputStream (send-only)*any*
any annotated JAXB root element beantext/xml, application/xml
+ *

+ * Also keep in mind that you can always send/receive byte[] and do your own conversion. + *

+ * To use, simply pass a new {@link S3Config} object to the constructor like so: + *

+ *     // for client-side load balancing and direct connection to all nodes
+ *     //   single-VDC (client will auto-discover the remaining nodes):
+ *     S3Config config1 = new S3Config(Protocol.HTTP, "10.10.10.11", "10.10.10.12");
+ *     //   multiple VDCs (client will auto-discover remaining nodes in specified VDCs):
+ *     Vdc boston = new Vdc("10.10.10.11", "10.10.10.12").withName("Boston");
+ *     Vdc seattle = new Vdc("10.20.20.11", "10.20.20.12").withName("Seattle");
+ *     S3Config config2 = new S3Config(Protocol.HTTPS, boston, seattle);
+ *
+ *     // to use a load balancer will full wildcard DNS setup
+ *     S3Config config3 = new S3Config(new URI("https://s3.company.com")).withUseVHost(true);
+ *
+ *     // in all cases, you need to provide your credentials
+ *     configX.withIdentity("my_full_token_id").withSecretKey("my_secret_key");
+ *     S3Client s3Client = new S3JerseyClient(configX);
+ * 
+ *

+ * To create an object, simply pass the object in to one of the putObject methods. The object type must be one of + * the supported types above. + *

+ *     String stringContent = "Hello World!";
+ *     s3Client.putObject("my-bucket", "my-key", stringContent, "text/plain");
+ *
+ *     File fileContent = new File( "spreadsheet.xls" );
+ *     s3Client.putObject("my-bucket", "my-data", fileContent, "application/vnd.ms-excel");
+ *
+ *     byte[] binaryContent;
+ *     ... // load binary content to store as an object
+ *     s3Client.putObject("my-bucket", "my-bits", binaryContent, null ); // default content-type is application/octet-stream
+ * 
+ *

+ * To read an object, specify the type of object you want to receive from a readObject method. The same rules apply to + * this type. + *

+ *     String stringContent = s3Client.readObject("my-bucket", "my-key", String.class);
+ *
+ *     byte[] fileContent = s3Client.readObject("my-bucket", "my-data", byte[].class);
+ *     // do something with file content (stream to client? save in local filesystem?)
+ *
+ *     byte[] binaryContent = s3Client.readObject("my-bucket", "my-bits", byte[].class);
+ * 
+ *

+ * Performance + *

+ * If you are experiencing performance issues, you might try tuning Jersey's IO buffer size, which defaults to 8k. + *

+ *     System.setProperty(ReaderWriter.BUFFER_SIZE_SYSTEM_PROPERTY, "" + 128 * 1024); // 128k
+ * 
+ * You can also try using Jersey's URLConnectionClientHandler, but be aware that this handler does not support + * Expect: 100-Continue behavior if that is important to you. You should also increase + * http.maxConnections to match your thread count. + *
+ *     System.setProperty("http.maxConnections", "" + 32); // if you have 32 threads
+ *     S3Client s3Client = new S3JerseyClient(configX, new URLConnectionClientHandler());
+ * 
+ */ public class S3JerseyClient extends AbstractJerseyClient implements S3Client { private static final Logger l4j = Logger.getLogger(S3JerseyClient.class); @@ -57,16 +133,30 @@ public class S3JerseyClient extends AbstractJerseyClient implements S3Client { protected LoadBalancer loadBalancer; public S3JerseyClient(S3Config s3Config) { - super(s3Config); - this.s3Config = s3Config; + this(s3Config, null); + } + + /** + * Provide a specific Jersey ClientHandler implementation (default is ApacheHttpClient4Handler). If you experience + * performance problems, you might try using URLConnectionClientHandler, but note that it will not support the + * Expect: 100-Continue header. Also note that when using that handler, you should set the "http.maxConnections" + * system property to match your thread count (default is only 5). + */ + public S3JerseyClient(S3Config config, ClientHandler clientHandler) { + super(new S3Config(config)); // deep-copy config so that two clients don't share the same host lists (SDK-122) + s3Config = (S3Config) super.getObjectConfig(); SmartConfig smartConfig = s3Config.toSmartConfig(); loadBalancer = smartConfig.getLoadBalancer(); // creates a standard (non-load-balancing) jersey client - client = SmartClientFactory.createStandardClient(smartConfig); + if (clientHandler == null) { + client = SmartClientFactory.createStandardClient(smartConfig); + } else { + client = SmartClientFactory.createStandardClient(smartConfig, clientHandler); + } - if (!s3Config.isUseVHost()) { + if (s3Config.isSmartClient()) { // SMART CLIENT SETUP // S.C. - ENDPOINT POLLING @@ -99,12 +189,16 @@ public S3JerseyClient(S3Config s3Config) { // S.C. - CLIENT CREATION // create a load-balancing jersey client - client = SmartClientFactory.createSmartClient(smartConfig); + if (clientHandler == null) { + client = SmartClientFactory.createSmartClient(smartConfig); + } else { + client = SmartClientFactory.createSmartClient(smartConfig, clientHandler); + } } // jersey filters client.addFilter(new ErrorFilter()); - client.addFilter(new ChecksumFilter()); + if (s3Config.isChecksumEnabled()) client.addFilter(new ChecksumFilter()); client.addFilter(new AuthorizationFilter(s3Config)); client.addFilter(new BucketFilter(s3Config)); client.addFilter(new NamespaceFilter(s3Config)); @@ -498,4 +592,8 @@ protected T executeRequest(Client client, ObjectRequest request, Class re } } } + + public S3Config getS3Config() { + return s3Config; + } } diff --git a/src/main/java/com/emc/object/s3/request/AbstractBucketRequest.java b/src/main/java/com/emc/object/s3/request/AbstractBucketRequest.java index 077e1ef9..2ec73ed0 100644 --- a/src/main/java/com/emc/object/s3/request/AbstractBucketRequest.java +++ b/src/main/java/com/emc/object/s3/request/AbstractBucketRequest.java @@ -48,6 +48,7 @@ public String getBucketName() { } public void setBucketName(String bucketName) { + if (bucketName == null || "".equals(bucketName)) throw new IllegalArgumentException("bucket is required"); this.bucketName = bucketName; property(S3Constants.PROPERTY_BUCKET_NAME, bucketName); } diff --git a/src/main/java/com/emc/object/s3/request/CopyObjectRequest.java b/src/main/java/com/emc/object/s3/request/CopyObjectRequest.java index 0f27fefa..d17a6733 100644 --- a/src/main/java/com/emc/object/s3/request/CopyObjectRequest.java +++ b/src/main/java/com/emc/object/s3/request/CopyObjectRequest.java @@ -61,7 +61,7 @@ public CopyObjectRequest(String sourceBucketName, String sourceKey, String bucke public Map> getHeaders() { Map> headers = super.getHeaders(); - String source = String.format("/%s/%s", sourceBucketName, sourceKey); + String source = String.format("/%s/%s", RestUtil.urlEncode(sourceBucketName), RestUtil.urlEncode(sourceKey)); if (sourceVersionId != null) source += "?versionId=" + sourceVersionId; RestUtil.putSingle(headers, S3Constants.AMZ_COPY_SOURCE, source); diff --git a/src/main/java/com/emc/object/s3/request/CreateBucketRequest.java b/src/main/java/com/emc/object/s3/request/CreateBucketRequest.java index 2bf6a94f..b7327eda 100644 --- a/src/main/java/com/emc/object/s3/request/CreateBucketRequest.java +++ b/src/main/java/com/emc/object/s3/request/CreateBucketRequest.java @@ -35,6 +35,9 @@ import java.util.List; import java.util.Map; +/** + * Encapsulates parameters for a create bucket request. + */ public class CreateBucketRequest extends AbstractBucketRequest { private CannedAcl cannedAcl; private AccessControlList acl; diff --git a/src/main/java/com/emc/object/util/RestUtil.java b/src/main/java/com/emc/object/util/RestUtil.java index be0da255..ba941c13 100644 --- a/src/main/java/com/emc/object/util/RestUtil.java +++ b/src/main/java/com/emc/object/util/RestUtil.java @@ -27,6 +27,8 @@ package com.emc.object.util; import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URLDecoder; import java.net.URLEncoder; import java.text.DateFormat; @@ -180,6 +182,16 @@ public static Date headerParse(String dateString) { } } + public static String getEncodedPath(URI uri) { + + // this is the only way I've found to get the true encoded path + String rawUri = uri.toASCIIString(); + String path = rawUri.substring(rawUri.indexOf("/", 9)); + if (path.contains("?")) path = path.substring(0, path.indexOf("?")); + if (path.contains("#")) path = path.substring(0, path.indexOf("#")); + return path; + } + public static String urlEncode(String value) { if (value == null) return null; // Use %20, not + @@ -200,6 +212,21 @@ public static String urlDecode(String value) { } } + public static URI buildUri(String scheme, String host, int port, String path, String query, String fragment) + throws URISyntaxException { + URI uri = new URI(scheme, null, host, port, path, query, fragment); + + // Special case to handle "+" characters that URI doesn't handle well. + return new URI(uri.toASCIIString().replace("+", "%2b")); + } + + public static URI replaceHost(URI uri, String host) throws URISyntaxException { + return buildUri(uri.getScheme(), host, uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment()); + } + + public static URI replacePath(URI uri, String path) throws URISyntaxException { + return buildUri(uri.getScheme(), uri.getHost(), uri.getPort(), path, uri.getQuery(), uri.getFragment()); + } private static DateFormat getHeaderFormat() { DateFormat format = headerFormat.get(); if (format == null) { diff --git a/src/test/java/com/emc/object/s3/AbstractS3ClientTest.java b/src/test/java/com/emc/object/s3/AbstractS3ClientTest.java index 2c7ab2f8..dab1e046 100644 --- a/src/test/java/com/emc/object/s3/AbstractS3ClientTest.java +++ b/src/test/java/com/emc/object/s3/AbstractS3ClientTest.java @@ -94,9 +94,10 @@ protected S3Config createS3Config() throws Exception { S3Config s3Config; if (enableVhost) { - s3Config = new S3VHostConfig(endpoint); + s3Config = new S3Config(endpoint).withUseVHost(true); } else if (endpoint.getPort() > 0) { - s3Config = new S3Config(Protocol.valueOf(endpoint.getScheme().toUpperCase()), endpoint.getPort(), new Vdc(endpoint.getHost())); + s3Config = new S3Config(Protocol.valueOf(endpoint.getScheme().toUpperCase()), new Vdc(endpoint.getHost())); + s3Config.setPort(endpoint.getPort()); } else { s3Config = new S3Config(Protocol.valueOf(endpoint.getScheme().toUpperCase()), endpoint.getHost()); } diff --git a/src/test/java/com/emc/object/s3/GeoPinningTest.java b/src/test/java/com/emc/object/s3/GeoPinningTest.java index ce92256a..71338a3f 100644 --- a/src/test/java/com/emc/object/s3/GeoPinningTest.java +++ b/src/test/java/com/emc/object/s3/GeoPinningTest.java @@ -63,7 +63,7 @@ protected void initClient() throws Exception { vdcs = Arrays.asList(vdc1, vdc2, vdc3); String proxyUri = s3Config.getPropAsString(ObjectConfig.PROPERTY_PROXY_URI); - s3Config = new S3Config(s3Config.getProtocol(), s3Config.getPort(), vdc1, vdc2, vdc3) + s3Config = new S3Config(s3Config.getProtocol(), vdc1, vdc2, vdc3).withPort(s3Config.getPort()) .withIdentity(s3Config.getIdentity()).withSecretKey(s3Config.getSecretKey()); if (proxyUri != null) s3Config.setProperty(ObjectConfig.PROPERTY_PROXY_URI, proxyUri); diff --git a/src/test/java/com/emc/object/s3/S3AuthUtilTest.java b/src/test/java/com/emc/object/s3/S3AuthUtilTest.java index c60a6695..a9d1326b 100644 --- a/src/test/java/com/emc/object/s3/S3AuthUtilTest.java +++ b/src/test/java/com/emc/object/s3/S3AuthUtilTest.java @@ -163,7 +163,7 @@ public void testSignature() { @Test public void testPresignedUrl() throws Exception { - S3Config s3Config = new S3VHostConfig(new URI("http://s3.amazonaws.com")) + S3Config s3Config = new S3Config(new URI("http://s3.amazonaws.com")).withUseVHost(true) .withIdentity("AKIAIOSFODNN7EXAMPLE").withSecretKey("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"); PresignedUrlRequest request = new PresignedUrlRequest(Method.GET, "johnsmith", "photos/puppy.jpg", diff --git a/src/test/java/com/emc/object/s3/S3JerseyClientTest.java b/src/test/java/com/emc/object/s3/S3JerseyClientTest.java old mode 100644 new mode 100755 index 3fb18876..2af194b9 --- a/src/test/java/com/emc/object/s3/S3JerseyClientTest.java +++ b/src/test/java/com/emc/object/s3/S3JerseyClientTest.java @@ -83,12 +83,18 @@ public void testMultipleVdcs() throws Exception { Vdc vdc1 = new Vdc("vdc1", new ArrayList(hosts)), vdc2 = new Vdc("vdc2", new ArrayList(hosts)); String proxyUri = config.getPropAsString(ObjectConfig.PROPERTY_PROXY_URI); - config = new S3Config(config.getProtocol(), config.getPort(), vdc1, vdc2) + config = new S3Config(config.getProtocol(), vdc1, vdc2).withPort(config.getPort()) .withIdentity(config.getIdentity()).withSecretKey(config.getSecretKey()); if (proxyUri != null) config.setProperty(ObjectConfig.PROPERTY_PROXY_URI, proxyUri); S3JerseyClient tempClient = new S3JerseyClient(config); + Thread.sleep(1000); // wait for poll to complete + + // the client will clone the config, so we have to get new references + vdc1 = tempClient.getS3Config().getVdcs().get(0); + vdc2 = tempClient.getS3Config().getVdcs().get(1); + Assert.assertTrue(vdc1.getHosts().size() > 1); Assert.assertTrue(vdc2.getHosts().size() > 1); Assert.assertEquals(vdc1.getHosts().size() + vdc2.getHosts().size(), @@ -143,6 +149,8 @@ public void testCreateBucketRequest() throws Exception { this.cleanUpBucket(bucketName); } + // TODO: blocked by STORAGE-7816 + @Ignore @Test public void testDeleteBucket() throws Exception { String bucketName = getTestBucket() + "-x"; @@ -1020,6 +1028,104 @@ public void testPutObject() throws Exception { Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); } + + @Test + public void testPutObjectWithSpace() throws Exception { + String key = "This Has a Space.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + @Test + public void testPutObjectWithPlus() throws Exception { + String key = "This+Has+a+Plus.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + @Test + public void testPutObjectWithPercent() throws Exception { + String key = "This is 100% or something.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + @Test + public void testPutObjectWithChinese() throws Exception { + String key = "解析依頼C1B068.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + + @Test + public void testPutObjectWithSmartQuote() throws Exception { + String key = "This is an ‘object’.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + /** + * Tests all the items in the java.net.URI "punct" character class. + */ + @Test + public void testPutObjectWithUriPunct() throws Exception { + String key = "URI punct characters ,;:$&+=.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } + + /** + * Tests all the items in the java.net.URI "reserved" character class. + */ + @Test + public void testPutObjectWithUriReserved() throws Exception { + String key = "URI reserved characters ?/[]@.txt"; + PutObjectRequest request = new PutObjectRequest(getTestBucket(), key, "Object Content"); + request.setObjectMetadata(new S3ObjectMetadata().withContentType("text/plain")); + client.putObject(request); + + ListObjectsResult result = client.listObjects(getTestBucket()); + List objList = result.getObjects(); + Assert.assertEquals("Failed to retrieve the object that was PUT", 1, objList.size()); + Assert.assertEquals("FAIL - name key is different", key, objList.get(0).getKey()); + } @Test public void testAppendObject() throws Exception { String key = "appendTest"; @@ -1048,6 +1154,135 @@ public void testCopyObject() throws Exception { Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); } + @Test + public void testCopyObjectPlusSource() throws Exception { + String key1 = "source+object+plus"; + String key2 = "copied-object-plus"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + @Test + public void testCopyObjectPlusDest() throws Exception { + String key1 = "source-object-plus-dest"; + String key2 = "copied+object+plus+dest"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + + @Test + public void testCopyObjectPlusBoth() throws Exception { + String key1 = "source+object+plus+both"; + String key2 = "copied+object+plus+both"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + @Test + public void testCopyObjectSpaceSrc() throws Exception { + String key1 = "source object space src"; + String key2 = "copied-object-space-src"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + @Test + public void testCopyObjectSpaceDest() throws Exception { + String key1 = "source-object-space-dest"; + String key2 = "copied object space dest"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + + @Test + public void testCopyObjectSpaceBoth() throws Exception { + String key1 = "source object space both"; + String key2 = "copied object space both"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + + @Test + public void testCopyObjectChineseSrc() throws Exception { + String key1 = "prefix/source-object-服务器-src"; + String key2 = "prefix/copied object chinese src"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + @Test + public void testCopyObjectChineseDest() throws Exception { + String key1 = "prefix/source-object-chinese-dest"; + String key2 = "prefix/copied object 服务器 dest"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + + @Test + public void testCopyObjectChineseBoth() throws Exception { + String key1 = "source-object-服务器-both"; + String key2 = "copied object 服务器 both"; + String content = "Hello Copy!"; + + client.putObject(getTestBucket(), key1, content, null); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + + client.copyObject(getTestBucket(), key1, getTestBucket(), key2); + Assert.assertEquals(content, client.readObject(getTestBucket(), key1, String.class)); + Assert.assertEquals(content, client.readObject(getTestBucket(), key2, String.class)); + } + @Test public void testCopyObjectSelf() throws Exception { String key = "object"; @@ -1378,6 +1613,22 @@ public void testGetObjectMetadata() throws Exception { S3ObjectMetadata objectMetadata = client.getObjectMetadata(getTestBucket(), testObject); this.validateMetadataValues(objectMetadata); } + + + @Test + public void testGetObjectMetadataNoExist() throws Exception { + String testObject = "/objectPrefix/noExist.txt"; + + try { + client.getObjectMetadata(getTestBucket(), testObject); + } catch(S3Exception e) { + Assert.assertEquals("Wrong HTTP status", 404, e.getHttpCode()); + Assert.assertEquals("Wrong ErrorCode", "NoSuchKey", e.getErrorCode()); + + // Should not chain a SAX error + Assert.assertNull("Should not be chained exception", e.getCause()); + } + } @Test public void testGetObjectMetadataRequest() throws Exception { diff --git a/src/test/java/com/emc/object/s3/S3JerseyUrlConnectionTest.java b/src/test/java/com/emc/object/s3/S3JerseyUrlConnectionTest.java new file mode 100644 index 00000000..6dca94b1 --- /dev/null +++ b/src/test/java/com/emc/object/s3/S3JerseyUrlConnectionTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, EMC Corporation. + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * + Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + The name of EMC Corporation may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +package com.emc.object.s3; + +import com.emc.object.s3.jersey.S3JerseyClient; +import com.sun.jersey.client.urlconnection.URLConnectionClientHandler; + +public class S3JerseyUrlConnectionTest extends S3JerseyClientTest { + @Override + protected String getTestBucketPrefix() { + return "s3-url-connection-test"; + } + + @Override + public void initClient() throws Exception { + System.setProperty("http.maxConnections", "100"); + client = new S3JerseyClient(createS3Config(), new URLConnectionClientHandler()); + } +}