diff --git a/.gitignore b/.gitignore index ef2aa85..067250a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ target/ .classpath .project .settings/ +*-SNAPSHOT.jar diff --git a/de.weingardt.mylyn.gitlab.core/LICENSE b/de.weingardt.mylyn.gitlab.core/LICENSE new file mode 100644 index 0000000..5032843 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/LICENSE @@ -0,0 +1,203 @@ +Eclipse Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + +a) in the case of the initial Contributor, the initial code and documentation + distributed under this Agreement, and +b) in the case of each subsequent Contributor: + i) changes to the Program, and + ii) additions to the Program; + + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' + from a Contributor if it was added to the Program by such Contributor + itself or anyone acting on such Contributor's behalf. Contributions do not + include additions to the Program which: (i) are separate modules of + software distributed in conjunction with the Program under their own + license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents" mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly + perform, distribute and sublicense the Contribution of such Contributor, + if any, and such derivative works, in source code and object code form. + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of + the Contribution and the Program if, at the time the Contribution is + added by the Contributor, such addition of the Contribution causes such + combination to be covered by the Licensed Patents. The patent license + shall not apply to any other combinations which include the Contribution. + No hardware per se is licensed hereunder. + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor + disclaims any liability to Recipient for claims brought by any other + entity based on infringement of intellectual property rights or + otherwise. As a condition to exercising the rights and licenses granted + hereunder, each Recipient hereby assumes sole responsibility to secure + any other intellectual property rights needed, if any. For example, if a + third party patent license is required to allow Recipient to distribute + the Program, it is Recipient's responsibility to acquire that license + before distributing the Program. + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright + license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under +its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + b) its license agreement: + i) effectively disclaims on behalf of all Contributors all warranties + and conditions, express and implied, including warranties or + conditions of title and non-infringement, and implied warranties or + conditions of merchantability and fitness for a particular purpose; + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and + consequential damages, such as lost profits; + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable + manner on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + b) a copy of this Agreement must be included with each copy of the Program. + Contributors may not remove or alter any copyright notices contained + within the Program. + +Each Contributor must identify itself as the originator of its Contribution, +if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, +if a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, +damages and costs (collectively "Losses") arising from claims, lawsuits and +other legal actions brought by a third party against the Indemnified +Contributor to the extent caused by the acts or omissions of such Commercial +Contributor in connection with its distribution of the Program in a commercial +product offering. The obligations in this section do not apply to any claims +or Losses relating to any actual or alleged intellectual property +infringement. In order to qualify, an Indemnified Contributor must: +a) promptly notify the Commercial Contributor in writing of such claim, and +b) allow the Commercial Contributor to control, and cooperate with the +Commercial Contributor in, the defense and any related settlement +negotiations. The Indemnified Contributor may participate in any such claim at +its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If +that Commercial Contributor then makes performance claims, or offers +warranties related to Product X, those performance claims and warranties are +such Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a +court requires any other Contributor to pay any damages as a result, the +Commercial Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each +Recipient is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to the +risks and costs of program errors, compliance with applicable laws, damage to +or loss of data, programs or equipment, and unavailability or interruption of +operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION +LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE +EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of the +remainder of the terms of this Agreement, and without further action by the +parties hereto, such provision shall be reformed to the minimum extent +necessary to make such provision valid and enforceable. + +If Recipient institutes patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Program itself +(excluding combinations of the Program with other software or hardware) +infringes such Recipient's patent(s), then such Recipient's rights granted +under Section 2(b) shall terminate as of the date such litigation is filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue +and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to +time. No one other than the Agreement Steward has the right to modify this +Agreement. The Eclipse Foundation is the initial Agreement Steward. The +Eclipse Foundation may assign the responsibility to serve as the Agreement +Steward to a suitable separate entity. Each new version of the Agreement will +be given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version of the +Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly +stated in Sections 2(a) and 2(b) above, Recipient receives no rights or +licenses to the intellectual property of any Contributor under this Agreement, +whether expressly, by implication, estoppel or otherwise. All rights in the +Program not expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial in +any resulting litigation. \ No newline at end of file diff --git a/de.weingardt.mylyn.gitlab.core/META-INF/MANIFEST.MF b/de.weingardt.mylyn.gitlab.core/META-INF/MANIFEST.MF index f062f1e..6884a9a 100644 --- a/de.weingardt.mylyn.gitlab.core/META-INF/MANIFEST.MF +++ b/de.weingardt.mylyn.gitlab.core/META-INF/MANIFEST.MF @@ -1,21 +1,23 @@ -Manifest-Version: 1.0 +eManifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Mylyn Gitlab Connector Core Bundle-SymbolicName: de.weingardt.mylyn.gitlab.core;singleton:=true -Bundle-Version: 1.6.0 +Bundle-Version: 1.6.1 Require-Bundle: org.eclipse.core.runtime, org.eclipse.mylyn.commons.core;bundle-version="[3.8.0,4.0.0)", org.eclipse.mylyn.commons.net;bundle-version="[3.8.0,4.0.0)", org.eclipse.mylyn.tasks.core;bundle-version="[3.8.0,4.0.0)" Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy -Export-Package: de.weingardt.mylyn.gitlab.core, - de.weingardt.mylyn.gitlab.core.exceptions, - org.gitlab.api.models +Export-Package: de.weingardt.mylyn.gitlab.core,de.weingardt.mylyn.gitl + ab.core.exceptions,org.gitlab.api.models Bundle-Vendor: Weingardt Software -Bundle-ClassPath: lib/gitlab-java.jar, - lib/commons-io-1.4.jar, - lib/jackson-core-asl-1.9.9.jar, - lib/jackson-mapper-asl-1.9.9.jar, - . +Bundle-ClassPath: ., + lib/commons-io-2.4.jar, + lib/jackson-annotations-2.5.3.jar, + lib/jackson-core-2.5.3.jar, + lib/jackson-databind-2.5.3.jar, + lib/slf4j-api-1.8.0-beta2.jar, + lib/slf4j-simple-1.8.0-beta2.jar, + lib/java-gitlab-api-4.0.1-SNAPSHOT.jar Bundle-Activator: de.weingardt.mylyn.gitlab.core.GitlabPluginCore diff --git a/de.weingardt.mylyn.gitlab.core/about.html b/de.weingardt.mylyn.gitlab.core/about.html new file mode 100644 index 0000000..8651e18 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about.html @@ -0,0 +1,73 @@ + + + + +About + + +

About This Content

+ +

July, 2016

+

License

+ +

Unless otherwise indicated below, all content of this plugin "Content" is provided to you under the terms +and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is +available at http://www.eclipse.org/legal/epl-v10.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

Third Party Content

+ +

+The Content includes items that have been sourced from third parties as set out below. The following is provided +for informational purposes only, and you should look to the Redistributor’s license for +terms and conditions of use. Third party licenses are aggregated in the "about_files" folder of this plugin. +

+ +

Apache Commons-IO

+

The plug-in includes Apache Commons-IO which is distributed under Apache License, Version 2.0. +A copy of the license is contained in the file LICENSE.txt and is also available at +http://www.apache.org/licenses/LICENSE-2.0.txt. +The Apache attribution NOTICE.txt file is included with the Content in accordance with 4d of the Apache License, Version 2.0.

+ +

Original binaries and source are available from http://commons.apache.org/proper/commons-io/.

+ +

Fasterxml Jackson-Core

+

The plug-in includes Fasterxml Jackson-Core which is distributed under Apache License, Version 2.0. +A copy of the license is contained in the file LICENSE.txt and is also available at +http://www.apache.org/licenses/LICENSE-2.0.txt. +The Apache attribution NOTICE.txt is not provided by the original authors.

+ +

Original sources are available from https://github.com/FasterXML/jackson-core.

+

Original binaries are available from http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/.

+ +

Fasterxml Jackson-Databind

+

The plug-in includes Fasterxml Jackson-Databind which is distributed under Apache License, Version 2.0. +A copy of the license is contained in the file LICENSE.txt and is also available at +http://www.apache.org/licenses/LICENSE-2.0.txt. +The Apache attribution NOTICE.txt is not provided by the original authors.

+ +

Original sources are available from https://github.com/FasterXML/jackson-databind.

+

Original binaries are available from http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/.

+ +

Fasterxml Jackson-Annotations

+

The plug-in includes Fasterxml Jackson-Annotations which is distributed under Apache License, Version 2.0. +A copy of the license is contained in the file LICENSE.txt and is also available at +http://www.apache.org/licenses/LICENSE-2.0.txt. +The Apache attribution NOTICE.txt is not provided by the original authors.

+ +

Original sources are available from https://github.com/FasterXML/jackson-annotations.

+

Original binaries are available from http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/.

+ +

java-gitlab-api

+

The plug-in includesjava-gitlab-api which is distributed under Apache License, Version 2.0. +A copy of the license is contained in the file LICENSE.txt and refers to +http://www.apache.org/licenses/LICENSE-2.0.txt. +The Apache attribution NOTICE.txt is not provided by the original authors.

+ +

Original sources are available from https://github.com/timols/java-gitlab-api.

+

Original binaries are available from http://repo1.maven.org/maven2/org/gitlab/java-gitlab-api/.

+ + + + \ No newline at end of file diff --git a/de.weingardt.mylyn.gitlab.core/about_files/commons-io/LICENSE.txt b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/LICENSE.txt new file mode 100644 index 0000000..43e91eb --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/LICENSE.txt @@ -0,0 +1,203 @@ + + 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/de.weingardt.mylyn.gitlab.core/about_files/commons-io/NOTICE.txt b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/NOTICE.txt new file mode 100644 index 0000000..7632eb8 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/NOTICE.txt @@ -0,0 +1,6 @@ +Apache Commons IO +Copyright 2002-2012 The Apache Software Foundation + +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/). + diff --git a/de.weingardt.mylyn.gitlab.core/about_files/commons-io/RELEASE-NOTES.txt b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/RELEASE-NOTES.txt new file mode 100644 index 0000000..106cf35 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/commons-io/RELEASE-NOTES.txt @@ -0,0 +1,873 @@ + +Apache Commons IO +Version 2.4 +Release Notes + +INTRODUCTION: + +Commons IO is a package of Java utility classes like java.io. +Classes in this package are considered to be so standard and of such high +reuse as to justify existence in java.io. + +The Commons IO library contains utility classes, stream implementations, file filters, +file comparators, endian transformation classes, and much more. + +============================================================================== +Apache Commons IO Version 2.4 +============================================================================== +New features and bug fixes. + +Changes in this version include: + +New features: +o IO-269: Tailer locks file from deletion/rename on Windows. Thanks to sebb. +o IO-333: Export OSGi packages at version 1.x in addition to 2.x. Thanks to fmeschbe. +o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory. +o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). Thanks to ggregory. +o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory. +o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Thanks to ggregory, kinow. +o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks to raviprak. +o IO-324: Add missing Charset sister APIs to method that take a String charset name. Thanks to raviprak. + +Fixed Bugs: +o IO-336: Yottabyte (YB) incorrectly defined in FileUtils. Thanks to rleavelle. +o IO-279: Tailer erroneously considers file as new. Thanks to Sergio Bossa, Chris Baron. +o IO-335: Tailer#readLines - incorrect CR handling. +o IO-334: FileUtils.toURLs throws NPE for null parameter; document the behavior. +o IO-332: Improve tailer's reading performance. Thanks to liangly. +o IO-279: Improve Tailer performance with buffered reads (see IO-332). +o IO-329: FileUtils.writeLines uses unbuffered IO. Thanks to tivv. +o IO-319: FileUtils.sizeOfDirectory follows symbolic links. Thanks to raviprak. + + +Compatibility with 2.3: +Binary compatible: Yes. +Source compatible: Yes. +Semantic compatible: Yes. + +Compatibility with 2.2 and 1.4: +Binary compatible: Yes. +Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. + +Commons IO 2.4 requires JDK 1.6 or later. +Commons IO 2.3 requires JDK 1.6 or later. +Commons IO 2.2 requires JDK 1.5 or later. +Commons IO 1.4 requires JDK 1.3 or later. + +============================================================================== +Apache Commons IO Version 2.3 +============================================================================== + +Changes in this version include: + +New features: +o IO-322: Add and use class Charsets. Thanks to ggregory. +o IO-321: ByteOrderMark UTF_32LE is incorrect. Thanks to ggregory. +o IO-318: Add Charset sister APIs to method that take a String charset name. Thanks to ggregory. + +Compatibility with 2.2 and 1.4: +Binary compatible: Yes. +Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. +Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318. + +Commons IO 2.3 requires JDK 1.6 or later. +Commons IO 2.2 requires JDK 1.5 or later. +Commons IO 1.4 requires JDK 1.3 or later. + +============================================================================== +Apache Commons IO Version 2.2 +============================================================================== + +Changes in this version include: + +New features: +o Add IOUTils.toBufferedReader(Reader) Issue: IO-313. Thanks to ggregory. +o Allow applications to provide buffer (or size) for copyLarge methods. Issue: IO-308. Thanks to Manoj Mokashi. +o New copyLarge() method in IOUtils that takes additional offset, length arguments Issue: IO-305. Thanks to Manoj Mokashi. +o Use terabyte (TB), petabyte (PB) and exabyte (EB) in FileUtils.byteCountToDisplaySize(long size) Issue: IO-287. Thanks to Ron Kuris, Gary Gregory. +o FileUtils.listFiles() doesn't return directories Issue: IO-173. Thanks to Marcos Vinícius da Silva. +o CharSequenceInputStream to efficiently stream content of a CharSequence Issue: IO-297. Thanks to Oleg Kalnichevski. +o The second constructor of Tailer class does not pass 'delay' to the third one Issue: IO-304. Thanks to liangly. +o TeeOutputStream does not call branch.close() when main.close() throws an exception Issue: IO-303. Thanks to fabian.barney. +o ArrayIndexOutOfBoundsException in BOMInputStream when reading a file without BOM multiple times Issue: IO-302. Thanks to jsteuerwald, detinho. +o Add IOUtils.closeQuietly(Selector) necessary Issue: IO-301. Thanks to kaykay.unique. +o IOUtils.closeQuietly() should take a ServerSocket as a parameter Issue: IO-292. Thanks to sebb. +o Add read/readFully methods to IOUtils Issue: IO-290. Thanks to sebb. +o Supply a ReversedLinesFileReader Issue: IO-288. Thanks to Georg Henzler. +o Add new function FileUtils.directoryContains. Issue: IO-291. Thanks to ggregory. +o FileUtils.contentEquals and IOUtils.contentEquals - Add option to ignore "line endings" + Added contentEqualsIgnoreEOL methods to both classes Issue: IO-275. Thanks to CJ Aspromgos. + +Fixed Bugs: +o IOUtils.read(InputStream/Reader) ignores the offset parameter Issue: IO-311. Thanks to Robert Muir. +o CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores bufferSize Issue: IO-312. +o FileUtils.moveDirectoryToDirectory removes source directory if destination is a subdirectory Issue: IO-300. +o ReaderInputStream#read(byte[] b, int off, int len) should check for valid parameters Issue: IO-307. +o ReaderInputStream#read(byte[] b, int off, int len) should always return 0 for length == 0 Issue: IO-306. +o "FileUtils#deleteDirectoryOnExit(File)" does not work Issue: IO-276. Thanks to nkami. +o BoundedInputStream.read() treats max differently from BoundedInputStream.read(byte[]...) Issue: IO-273. Thanks to sebb. +o Various methods of class 'org.apache.commons.io.FileUtils' incorrectly suppress 'java.io.IOException' Issue: IO-298. Thanks to Christian Schulte. + +Changes: +o ReaderInputStream optimization: more efficient reading of small chunks of data Issue: IO-296. Thanks to Oleg Kalnichevski. + + +Compatibility with 2.1 and 1.4: +Binary compatible: Yes +Source compatible: Yes +Semantic compatible: Yes. Check the bug fixes section for semantic bug fixes + +Commons IO 2.2 requires a minimum of JDK 1.5. +Commons IO 1.4 requires a minimum of JDK 1.3. + +============================================================================== +Apache Commons IO Version 2.1 +============================================================================== + +New features: +o Use standard Maven directory layout Issue: IO-285. Thanks to ggregory. +o Add IOUtils API toString for URL and URI to get contents Issue: IO-284. Thanks to ggregory. +o Add API FileUtils.copyFile(File input, OutputStream output) Issue: IO-282. Thanks to ggregory. +o FileAlterationObserver has no getter for FileFilter Issue: IO-262. +o Add FileUtils.getFile API with varargs parameter Issue: IO-261. +o Add new APPEND parameter for writing string into files Issue: IO-182. +o Add new read method "toByteArray" to handle InputStream with known size. Issue: IO-251. Thanks to Marco Albini. + +Fixed Bugs: +o Dubious use of mkdirs() return code Issue: IO-280. Thanks to sebb. +o ReaderInputStream enters infinite loop when it encounters an unmappable character Issue: IO-277. +o FileUtils.moveFile() JavaDoc should specify FileExistsException thrown Issue: IO-264. +o ClassLoaderObjectInputStream does not handle Proxy classes Issue: IO-260. +o Tailer returning partial lines when reaching EOF before EOL Issue: IO-274. Thanks to Frank Grimes. +o FileUtils.copyFile() throws IOException when copying large files to a shared directory (on Windows) Issue: IO-266. Thanks to Igor Smereka. +o FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files. + Improve coverage by also looking for hidden files. Issue: IO-263. Thanks to Gil Adam. + +Changes: +o FileAlterationMonitor.stop(boolean allowIntervalToFinish) Issue: IO-259. + +============================================================================== +Apache Commons IO Package 2.0.1 +============================================================================== + +Compatibility with 2.0 and 1.4 +------------------------------ +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + Check the bug fixes section for semantic bug fixes + +Commons IO 2.0.1 requires a minimum of JDK 1.5 + (Commons IO 1.4 had a minimum of JDK 1.3) + +Enhancements from 2.0 +--------------------- + + * [IO-256] - Provide thread factory for FileAlternationMonitor + +Bug fixes from 2.0 +------------------ + + * [IO-257] - BOMInputStream.read(byte[]) can return 0 which it should not + * [IO-258] - XmlStreamReader consumes the stream during encoding detection + +============================================================================== +Apache Commons IO Package 2.0 +============================================================================== + +Compatibility with 1.4 +---------------------- +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + Check the bug fixes section for semantic bug fixes + +Commons IO 2.0 requires a minimum of JDK 1.5 + (Commons IO 1.4 had a minimum of JDK 1.3) + +Deprecations from 1.4 +--------------------- + +- IOUtils + - write(StringBuffer, Writer) in favour of write(CharSequence, Writer) + - write(StringBuffer, OutputStream) in favour of write(CharSequence, OutputStream) + - write(StringBuffer, OutputStream, String) in favour of write(CharSequence, OutputStream, String) + +- FileFilterUtils + - andFileFilter(IOFileFilter, IOFileFilter) in favour of and(IOFileFilter...) + - orFileFilter(IOFileFilter, IOFileFilter) in favour of or(IOFileFilter...) + +Enhancements from 1.4 +--------------------- + + * [IO-140] Move minimum Java requirement from JDK 1.3 to JDK 1.5 + - use Generics + - add new CharSequence write() flavour methods to IOUtils and FileUtils + - replace StringBuffer with StringBuilder, where appropriate + - add new Reader/Writer methods to ProxyReader and ProxyWriter + - Annotate with @Override and @Deprecated + + * [IO-178] New BOMInputStream and ByteOrderMark implementations - to detect and optionally exclude an initial Byte Order mark (BOM) + * [IO-197] New BoundedInputStream (copied from from Apache JackRabbit) + * [IO-193] New Broken Input and Output streams + * [IO-132] New File Listener/Monitor facility + * [IO-158] New ReaderInputStream and WriterOutputStream implementations + * [IO-139] New StringBuilder Writer implementation + * [IO-192] New Tagged Input and Output streams + * [IO-177] New Tailer class - simple implementation of the Unix "tail -f" functionality + * [IO-162] New XML Stream Reader/Writer implementations (from ROME via plexus-utils) + + * [IO-142] Comparators - add facility to sort file lists/arrays + * [IO-186] Comparators - new Composite and Directory File Comparator implementations + * [IO-176] DirectoryWalker - add filterDirectoryContents() callback method for filtering directory contents + * [IO-210] FileFilter - new Magic Number FileFilter + * [IO-221] FileFilterUtils - add methods for suffix and prefix filters which take an IOCase object + * [IO-232] FileFilterUtils - add method for name filters which take an IOCase object + * [IO-229] FileFilterUtils - add varargs and() and or() methods + * [IO-198] FileFilterUtils - add ability to apply file filters to collections and arrays + * [IO-156] FilenameUtils - add normalize() and normalizeNoEndSeparator() methods which allow the separator character to be specified + * [IO-194] FileSystemUtils - add freeSpaceKb() method with no input arguments + * [IO-185] FileSystemUtils - add freeSpaceKb() methods that take a timeout parameter - fixes freeSpaceWindows() blocks + * [IO-155] FileUtils - use NIO to copy files + * [IO-168] FileUtils - add new isSymlink() method + * [IO-219] FileUtils - throw FileExistsException when moving a file or directory if the destination already exists + * [IO-234] FileUtils - add Methods for retrieving System User/Temp directories/paths + * [IO-208] FileUtils - add timeout (connection and read) support for copyURLToFile() method + * [IO-238] FileUtils - add sizeOf(File) method + * [IO-181] LineIterator now implements Iterable + * [IO-224] IOUtils - add closeQuietly(Closeable) and closeQuietly(Socket) methods + * [IO-203] IOUtils - add skipFully() method for InputStreams + * [IO-137] IOUtils and ByteArrayOutputStream - add toBufferedInputStream() method to avoid unnecessary array allocation/copy + * [IO-195] Proxy streams/Reader/Writer - provide exception handling methods + * [IO-211] Proxy Input/Output streams - add pre/post processing support + * [IO-242] Proxy Reader/Writer - add pre/post processing support + +Bug fixes from 1.4 +------------------ + * [IO-214] ByteArrayOutputStream - fix inconsistent synchronization of fields + * [IO-201] Counting Input/Output streams - fix inconsistent synchronization + * [IO-159] FileCleaningTracker - fix remove() never returns null + * [IO-220] FileCleaningTracker - fix Vector performs badly under load + * [IO-167] FilenameUtils - fix case-insensitive string handling in FilenameUtils and FilesystemUtils + * [IO-179] FilenameUtils - fix StringIndexOutOfBounds exception in getPathNoEndSeparator() + * [IO-248] FilenameUtils - fix getFullPathNoEndSeparator() returns empty while path is a one level directory + * [IO-246] FilenameUtils - fix wildcardMatch gives incorrect results + * [IO-187] FileSystemUtils - fix freeSpaceKb() doesn't work with relative paths on Linux + * [IO-160] FileSystemUtils - fix freeSpace() fails on solaris + * [IO-209] FileSystemUtils - fix freeSpaceKb() fails to return correct size for a windows mount point + * [IO-163] FileUtils - fix toURLs() using deprecated method of conversion to URL + * [IO-168] FileUtils - fix Symbolic links followed when deleting directory + * [IO-231] FileUtils - fix wrong exception message generated in isFileNewer() method + * [IO-207] FileUtils - fix race condition in forceMkdir() method + * [IO-217] FileUtils - fix copyDirectoryToDirectory() makes infinite loops + * [IO-166] FileUtils - fix URL decoding in toFile(URL) + * [IO-190] FileUtils - fix copyDirectory not preserving lastmodified date on sub-directories + * [IO-240] FileFilterUtils - ensure cvsFilter and svnFilter are only created once. + * [IO-175] IOUtils - fix copyFile() issues with very large files + * [IO-191] Improvements from static analysis + * [IO-216] LockableFileWriter - delete files quietly when an exception is thrown during initialization + * [IO-243] SwappedDataInputStream - fix readBoolean is inverted + * [IO-235] Tests - remove unused YellOnFlushAndCloseOutputStream from CopyUtilsTest + * [IO-161] Tests - fix FileCleaningTrackerTestCase hanging + +Documentation changes from 1.4 +------------------------------ + * [IO-183 FilenameUtils.getExtension() method documentation improvements + * [IO-226 FileUtils.byteCountToDisplaySize() documentation corrections + * [IO-205 FileUtils.forceMkdir() documentation improvements + * [IO-215 FileUtils copy file/directory improve documentation regarding preserving the last modified date + * [IO-189 HexDump.dump() method documentation improvements + * [IO-171 IOCase document that it assumes there are only two OSes: Windows and Unix + * [IO-223 IOUtils.copy() documentation corrections + * [IO-247 IOUtils.closeQuietly() improve documentation with examples + * [IO-202 NotFileFilter documentation corrections + * [IO-206 ProxyInputStream - fix misleading parameter names + * [IO-212 ProxyInputStream.skip() documentation corrections + +============================================================================== +Apache Commons IO Version 1.4 +============================================================================== + +Compatibility with 1.3.2 +------------------------ +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + Check the bug fixes section for semantic bug fixes + +Commons IO 1.4 introduces four new implementations which depend on JDK 1.4 features +(CharSequenceReader, FileWriterWithEncoding, IOExceptionWithCause and RegexFileFilter). +It has been built with the JDK source and target options set to JDK 1.3 and, except for +those implementations, can be used with JDK 1.3 (see IO IO-127). + +Deprecations from 1.3.2 +----------------------- +- FileCleaner deprecated in favour of FileCleaningTracker [see IO-116] + +Bug fixes from 1.3.2 +-------------------- +- FileUtils + - forceDelete of orphaned Softlinks does not work [IO-147] + - Infinite loop on FileUtils.copyDirectory when the destination directory is within + the source directory [IO-141] + - Add a copyDirectory() method that makes use of FileFilter [IO-105] + - Add moveDirectory() and moveFile() methods [IO-77] + +- HexDump + - HexDump's use of static StringBuffers isn't thread-safe [IO-136] + +Enhancements from 1.3.2 +----------------------- +- FileUtils + - Add a deleteQuietly method [IO-135] + +- FilenameUtils + - Add file name extension separator constants[IO-149] + +- IOExceptionWithCause [IO-148] + - Add a new IOException implementation with constructors which take a cause + +- TeeInputStream [IO-129] + - Add new Tee input stream implementation + +- FileWriterWithEncoding [IO-153] + - Add new File Writer implementation that accepts an encoding + +- CharSequenceReader [IO-138] + - Add new Reader implementation that handles any CharSequence (String, + StringBuffer, StringBuilder or CharBuffer) + +- ThesholdingOuputStream [IO-121] + - Add a reset() method which sets the count of the bytes written back to zero. + +- DeferredFileOutputStream [IO-130] + - Add support for temporary files + +- ByteArrayOutputStream + - Add a new write(InputStream) method [IO-152] + +- New Closed Input/Output stream implementations [IO-122] + - AutoCloseInputStream - automatically closes and discards the underlying input stream + - ClosedInputStream - returns -1 for any read attempts + - ClosedOutputStream - throws an IOException for any write attempts + - CloseShieldInputStream - prevents the underlying input stream from being closed. + - CloseShieldOutputStream - prevents the underlying output stream from being closed. + +- Add Singleton Constants to several stream classes [IO-143] + +- PrefixFileFilter [IO-126] + - Add faciltiy to specify case sensitivity on prefix matching + +- SuffixFileFilter [IO-126] + - Add faciltiy to specify case sensitivity on suffix matching + +- RegexFileFilter [IO-74] + - Add new regular expression file filter implementation + +- Make IOFileFilter implementations Serializable [IO-131] + +- Improve IOFileFilter toString() methods [IO-120] + +- Make fields final so classes are immutable/threadsafe [IO-133] + - changes to Age, Delegate, Name, Not, Prefix, Regex, Size, Suffix and Wildcard IOFileFilter + implementations. + +- IOCase + - Add a compare method to IOCase [IO-144] + +- Add a package of java.util.Comparator implementations for files [IO-145] + - DefaultFileComparator - compare files using the default File.compareTo(File) method. + - ExtensionFileComparator - compares files using file name extensions. + - LastModifiedFileComparator - compares files using the last modified date/time. + - NameFileComparator - compares files using file names. + - PathFileComparator - compares files using file paths. + - SizeFileComparator - compares files using file sizes. + +============================================================================== +Apache Commons IO Version 1.3.2 +============================================================================== + +Compatibility with 1.3.1 +---------------------- +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + +Compatibility with 1.3 +---------------------- +Binary compatible - No + See [IO-113] + +Source compatible - No + See [IO-113] + +Semantic compatible - Yes + +Enhancements since 1.3.1 +------------------------ + +- Created the FileCleaningTracker, basically a non-static version of the + FileCleaner, which can be controlled by the user. [IO-116] +- The FileCleaner is deprecated. + +Bug fixes from 1.3.1 +-------------------- + +- Some tests, which are implicitly assuming a Unix-like file system, are + now skipped on Windows. [IO-115] +- EndianUtils + - Both readSwappedUnsignedInteger(...) methods could return negative + numbers due to int/long casting. [IO-117] + +Bug fixes from 1.3 +------------------ + +- FileUtils + - NPE in openOutputStream(File) when file has no parent in path [IO-112] + - readFileToString(File) is not static [IO-113] + +============================================================================== +Apache Commons IO Version 1.3.1 +============================================================================== + +Compatibility with 1.3 +---------------------- +Binary compatible - No + See [IO-113] + +Source compatible - No + See [IO-113] + +Semantic compatible - Yes + +Bug fixes from 1.3 +------------------ + +- FileUtils + - NPE in openOutputStream(File) when file has no parent in path [IO-112] + - readFileToString(File) is not static [IO-113] + +============================================================================== +Apache Commons IO Version 1.3 +============================================================================== + +Compatibility with 1.2 +---------------------- +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + Check the bug fixes section for semantic bug fixes + +Deprecations from 1.2 +--------------------- +- WildcardFilter deprecated, replaced by WildcardFileFilter + - old class only accepted files, thus had a confusing dual purpose + +- FileSystemUtils.freeSpace deprecated, replaced by freeSpaceKb + - freeSpace returns a result that varies by operating system and + thus isn't that useful + - freeSpaceKb returns much better and more consistent results + - freeSpaceKb existed in v1.2, so this is a gentle cutover + +Bug fixes from 1.2 +------------------ +- LineIterator now implements Iterator + - It was always supposed to... + +- FileSystemUtils.freeSpace/freeSpaceKb [IO-83] + - These should now work on AIX and HP-UX + +- FileSystemUtils.freeSpace/freeSpaceKb [IO-90] + - Avoid infinite looping in Windows + - Catch more errors with nice messages + +- FileSystemUtils.freeSpace [IO-91] + - This is now documented not to work on SunOS 5 + +- FileSystemUtils [IO-93] + - Fixed resource leak leading to 'Too many open files' error + - Previously did not destroy Process instances (as JDK Javadoc is so poor) + - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4801027 + +- FileUtils.touch [IO-100] + - The touch method previously gave no indication when the file could not + be touched successfully (such as due to access restrictions) - it now + throws an IOException if the last modified date cannot be changed + +- FileCleaner + - This now handles the situation where an error occurs when deleting the file + +- IOUtils.copy [IO-84] + - Copy methods could return inaccurate byte/char count for large streams + - The copy(InputStream, OutputStream) method now returns -1 if the count is greater than an int + - The copy(Reader, Writer) method now throws now returns -1 if the count is greater than an int + - Added a new copyLarge(InputStream, OutputStream) method that returns a long + - Added a new copyLarge(Reader, Writer) method that returns a long + +- CountingInputStream/CountingOutputStream [IO-84] + - Methods were declared as int thus the count was innacurate for large streams + - new long based methods getByteCount()/resetByteCount() added + - existing methods changed to throw an exception if the count is greater than an int + +- FileBasedTestCase + - Fixed bug in compare content methods identified by GNU classpath + +- EndianUtils.writeSwappedLong(byte[], int) [IO-101] + - An int overrun in the bit shifting when it should have been a long + +- EndianUtils.writeSwappedLong(InputStream) [IO-102] + - The return of input.read(byte[]) was not being checked to ensure all 8 bytes were read + +Enhancements from 1.2 +--------------------- +- DirectoryWalker [IO-86] + - New class designed for subclassing to walk through a set of files. + DirectoryWalker provides the walk of the directories, filtering of + directories and files, and cancellation support. The subclass must provide + the specific behaviour, such as text searching or image processing. + +- IOCase + - New class/enumeration for case-sensitivity control + +- FilenameUtils + - New methods to handle case-sensitivity + - wildcardMatch - new method that has IOCase as a parameter + - equals - new method that has IOCase as a parameter + +- FileUtils [IO-108] - new default encoding methods for: + - readFileToString(File) + - readLines(File) + - lineIterator(File) + - writeStringToFile(File, String) + - writeLines(File, Collection) + - writeLines(File, Collection, String) + +- FileUtils.openOutputStream [IO-107] + - new method to open a FileOutputStream, creating parent directories if required +- FileUtils.touch +- FileUtils.copyURLToFile +- FileUtils.writeStringToFile +- FileUtils.writeByteArrayToFile +- FileUtils.writeLines + - enhanced to create parent directories if required +- FileUtils.openInputStream [IO-107] + - new method to open a FileInputStream, providing better error messages than the JDK + +- FileUtils.isFileOlder + - new methods to check if a file is older (i.e. isFileOlder()) - counterparts + to the existing isFileNewer() methods. + +- FileUtils.checksum, FileUtils.checksumCRC32 + - new methods to create a checksum of a file + +- FileUtils.copyFileToDirectory [IO-104] + - new variant that optionally retains the file date + +- FileDeleteStrategy +- FileCleaner [IO-56,IO-70] + - FileDeleteStrategy is a strategy for handling file deletion + - This can be used as a calback in FileCleaner + - Together these allow FileCleaner to do a forceDelete to kill directories + +- FileCleaner.exitWhenFinished [IO-99] + - A new method that allows the internal cleaner thread to be cleanly terminated + +- WildcardFileFilter + - Replacement for WildcardFilter + - Accepts both files and directories + - Ability to control case-sensitivity + +- NameFileFilter + - Ability to control case-sensitivity + +- FileFileFilter + - New IOFileFilter implementation + - Accepts files where File.isFile() is true + - In other words it filters out directories + - Singleton instance provided (FILE) + +- CanReadFileFilter + - New IOFileFilter implementation + - Accepts files where File.canRead() is true + - Singleton instances provided (CAN_READ/CANNOT_READ/READ_ONLY) + +- CanWriteFileFilter + - New IOFileFilter implementation + - Accepts files where File.canWrite() is true + - Singleton instances provided (CAN_WRITE/CANNOT_WRITE) + +- HiddenFileFilter + - New IOFileFilter implementation + - Accepts files where File.isHidden() is true + - Singleton instances provided (HIDDEN/VISIBLE) + +- EmptyFileFilter + - New IOFileFilter implementation + - Accepts files or directories that are empty + - Singleton instances provided (EMPTY/NOT_EMPTY) + +- TrueFileFilter/FalseFileFilter/DirectoryFileFilter + - New singleton instance constants (TRUE/FALSE/DIRECTORY) + - The new constants are more JDK 1.5 friendly with regards to static imports + (whereas if everything uses INSTANCE, then they just clash) + - The old INSTANCE constants are still present and have not been deprecated + +- FileFilterUtils.sizeRangeFileFilter + - new sizeRangeFileFilter(long minimumSize, long maximumSize) method which + creates a filter that accepts files within the specified size range. + +- FileFilterUtils.makeDirectoryOnly/makeFileOnly + - two new methods that decorate a file filter to make it apply to + directories only or files only + +- NullWriter + - New writer that acts as a sink for all data, as per /dev/null + +- NullInputStream + - New input stream that emulates a stream of a specified size + +- NullReader + - New reader that emulates a reader of a specified size + +- ByteArrayOutputStream [IO-97] + - Performance enhancements + +============================================================================== +Apache Commons IO Version 1.2 +============================================================================== + +Compatibility with 1.1 +---------------------- +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes + +Deprecations from 1.1 +--------------------- + +Bug fixes from 1.1 +------------------ +- FileSystemUtils.freeSpace(drive) + Fix to allow Windows based command to function in French locale + +- FileUtils.read* + Increase certainty that files are closed in case of error + +- LockableFileWriter + Locking mechanism was broken and only provided limited protection [38942] + File deletion and locking in case of constructor error was broken + +Enhancements from 1.1 +--------------------- +- AgeFileFilter/SizeFileFilter + New file filters that compares against the age and size of the file + +- FileSystemUtils.freeSpaceKb(drive) + New method that unifies result to be in kilobytes [38574] + +- FileUtils.contentEquals(File,File) + Performance improved by adding length and file location checking + +- FileUtils.iterateFiles + Two new method to provide direct access to iterators over files + +- FileUtils.lineIterator + IOUtils.lineIterator + New methods to provide an iterator over the lines in a file [38083] + +- FileUtils.copyDirectoryToDirectory + New method to copy a directory to within another directory [36315] + +============================================================================== +Apache Commons IO Version 1.1 +============================================================================== + +Incompatible changes from 1.0 +----------------------------- +Binary compatible - Yes + +Source compatible - Yes + +Semantic compatible - Yes, except: +- FileUtils.writeStringToFile() + A null encoding previously used 'ISO-8859-1', now it uses the platform default + Generally this will make no difference + +- LockableFileWriter + Improved validation and now create directories if necesssary + +plus these bug fixes may affect you semantically: +- FileUtils.touch() (Bug fix 29821) + Now creates the file if it did not previously exist + +- FileUtils.toFile(URL) (Bug fix 32575) + Now handles escape syntax such as %20 + +- FileUtils.sizeOfDirectory() (Bug fix 36801) + May now return a size of 0 if the directory is security restricted + +Deprecations from 1.0 +--------------------- +- CopyUtils has been deprecated. + Its methods have been moved to IOUtils. + The new IOUtils methods handle nulls better, and have clearer names. + +- IOUtils.toByteArray(String) - Use {@link String#getBytes()} +- IOUtils.toString(byte[]) - Use {@link String#String(byte[])} +- IOUtils.toString(byte[],String) - Use {@link String#String(byte[],String)} + +Bug fixes from 1.0 +------------------ +- FileUtils - touch() [29821] + Now creates the file if it did not previously exist + +- FileUtils - toFile(URL) [32575] + Now handles escape syntax such as %20 + +- FileFilterUtils - makeCVSAware(IOFileFilter) [33023] + Fixed bug that caused method to be completely broken + +- CountingInputStream [33336] + Fixed bug that caused the count to reduce by one at the end of the stream + +- CountingInputStream - skip(long) [34311] + Bytes from calls to this method were not previously counted + +- NullOutputStream [33481] + Remove unecessary synchronization + +- AbstractFileFilter - accept(File, String) [30992] + Fixed broken implementation + +- FileUtils [36801] + Previously threw NPE when listing files in a security restricted directory + Now throw IOException with a better message + +- FileUtils - writeStringToFile() + Null encoding now correctly uses the platform default + +Enhancements from 1.0 +--------------------- +- FilenameUtils - new class [33303,29351] + A static utility class for working with filenames + Seeks to ease the pain of developing on Windows and deploying on Unix + +- FileSystemUtils - new class [32982,36325] + A static utility class for working with file systems + Provides one method at present, to get the free space on the filing system + +- IOUtils - new public constants + Constants for directory and line separators on Windows and Unix + +- IOUtils - toByteArray(Reader,encoding) + Handles encodings when reading to a byte array + +- IOUtils - toCharArray(InputStream) [28979] + - toCharArray(InputStream,encoding) + - toCharArray(Reader) + Reads a stream/reader into a charatcter array + +- IOUtils - readLines(InputStream) [36214] + - readLines(InputStream,encoding) + - readLines(Reader) + Reads a stream/reader line by line into a List of Strings + +- IOUtils - toInputStream(String) [32958] + - toInputStream(String,encoding) + Creates an input stream that uses the string as a source of data + +- IOUtils - writeLines(Collection,lineEnding,OutputStream) [36214] + - writeLines(Collection,lineEnding,OutputStream,encoding) + - writeLines(Collection,lineEnding,Writer) + Writes a collection to a stream/writer line by line + +- IOUtils - write(...) + Write data to a stream/writer (moved from CopyUtils with better null handling) + +- IOUtils - copy(...) + Copy data between streams (moved from CopyUtils with better null handling) + +- IOUtils - contentEquals(Reader,Reader) + Method to compare the contents of two readers + +- FileUtils - toFiles(URL[]) + Converts an array of URLs to an array of Files + +- FileUtils - copyDirectory() [32944] + New methods to copy a directory + +- FileUtils - readFileToByteArray(File) + Reads an entire file into a byte array + +- FileUtils - writeByteArrayToFile(File,byte[]) + Writes a byte array to a file + +- FileUtils - readLines(File,encoding) [36214] + Reads a file line by line into a List of Strings + +- FileUtils - writeLines(File,encoding,List) + writeLines(File,encoding,List,lineEnding) + Writes a collection to a file line by line + +- FileUtils - EMPTY_FILE_ARRAY + Constant for an empty array of File objects + +- ConditionalFileFilter - new interface [30705] + Defines the behaviour of list based filters + +- AndFileFilter, OrFileFilter [30705] + Now support a list of filters to and/or + +- WildcardFilter [31115] + New filter that can match using wildcard file names + +- FileFilterUtils - makeSVNAware(IOFileFilter) + New method, like makeCVSAware, that ignores Subversion source control directories + +- ClassLoaderObjectInputStream + An ObjectInputStream that supports a ClassLoader + +- CountingInputStream,CountingOutputStream - resetCount() [28976] + Adds the ability to reset the count part way through reading/writing the stream + +- DeferredFileOutputStream - writeTo(OutputStream) [34173] + New method to allow current contents to be written to a stream + +- DeferredFileOutputStream [34142] + Performance optimizations avoiding double buffering + +- LockableFileWriter - encoding support [36825] + Add support for character encodings to LockableFileWriter + Improve the validation + Create directories if necesssary + +- IOUtils and EndianUtils are no longer final [28978] + Allows developers to have subclasses if desired + +============================================================================== +Feedback +============================================================================== + +Open source works best when you give feedback: +http://commons.apache.org/io/ + +Please direct all bug reports to JIRA +http://issues.apache.org/jira/browse/IO + +Or subscribe to the commons-user mailing list (prefix emails by [io]) +http://commons.apache.org/mail-lists.html + +The Commons-IO Team diff --git a/de.weingardt.mylyn.gitlab.core/about_files/jackson-annotations/LICENSE.txt b/de.weingardt.mylyn.gitlab.core/about_files/jackson-annotations/LICENSE.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/jackson-annotations/LICENSE.txt @@ -0,0 +1,202 @@ + + 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/de.weingardt.mylyn.gitlab.core/about_files/jackson-core/LICENSE.txt b/de.weingardt.mylyn.gitlab.core/about_files/jackson-core/LICENSE.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/jackson-core/LICENSE.txt @@ -0,0 +1,202 @@ + + 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/de.weingardt.mylyn.gitlab.core/about_files/jackson-databind/LICENSE.txt b/de.weingardt.mylyn.gitlab.core/about_files/jackson-databind/LICENSE.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/jackson-databind/LICENSE.txt @@ -0,0 +1,202 @@ + + 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/de.weingardt.mylyn.gitlab.core/about_files/java-gitlab-api/LICENSE b/de.weingardt.mylyn.gitlab.core/about_files/java-gitlab-api/LICENSE new file mode 100644 index 0000000..2977f0c --- /dev/null +++ b/de.weingardt.mylyn.gitlab.core/about_files/java-gitlab-api/LICENSE @@ -0,0 +1,13 @@ +Copyright 2013-2014 Timothy Olshansky + +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/de.weingardt.mylyn.gitlab.core/build.properties b/de.weingardt.mylyn.gitlab.core/build.properties index cccab41..ecf3c22 100644 --- a/de.weingardt.mylyn.gitlab.core/build.properties +++ b/de.weingardt.mylyn.gitlab.core/build.properties @@ -1,3 +1,15 @@ source.. = src/ -bin.includes = META-INF/,.,plugin.xml,lib/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + lib/,\ + lib/commons-io-2.4.jar,\ + lib/jackson-annotations-2.5.3.jar,\ + lib/jackson-core-2.5.3.jar,\ + lib/jackson-databind-2.5.3.jar,\ + lib/slf4j-api-1.8.0-beta2.jar,\ + lib/slf4j-simple-1.8.0-beta2.jar,\ + about_files/,\ + about.html,\ + lib/java-gitlab-api-4.0.1-SNAPSHOT.jar jre.compilation.profile = JavaSE-1.7 diff --git a/de.weingardt.mylyn.gitlab.core/lib/commons-io-1.4.jar b/de.weingardt.mylyn.gitlab.core/lib/commons-io-1.4.jar deleted file mode 100644 index 133dc6c..0000000 Binary files a/de.weingardt.mylyn.gitlab.core/lib/commons-io-1.4.jar and /dev/null differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/commons-io-2.4.jar b/de.weingardt.mylyn.gitlab.core/lib/commons-io-2.4.jar new file mode 100644 index 0000000..90035a4 Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/commons-io-2.4.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/gitlab-java.jar b/de.weingardt.mylyn.gitlab.core/lib/gitlab-java.jar deleted file mode 100644 index ce7e300..0000000 Binary files a/de.weingardt.mylyn.gitlab.core/lib/gitlab-java.jar and /dev/null differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/jackson-annotations-2.5.3.jar b/de.weingardt.mylyn.gitlab.core/lib/jackson-annotations-2.5.3.jar new file mode 100644 index 0000000..6034dd0 Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/jackson-annotations-2.5.3.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/jackson-core-2.5.3.jar b/de.weingardt.mylyn.gitlab.core/lib/jackson-core-2.5.3.jar new file mode 100644 index 0000000..f3ae1ae Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/jackson-core-2.5.3.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/jackson-core-asl-1.9.9.jar b/de.weingardt.mylyn.gitlab.core/lib/jackson-core-asl-1.9.9.jar deleted file mode 100644 index d75843d..0000000 Binary files a/de.weingardt.mylyn.gitlab.core/lib/jackson-core-asl-1.9.9.jar and /dev/null differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/jackson-databind-2.5.3.jar b/de.weingardt.mylyn.gitlab.core/lib/jackson-databind-2.5.3.jar new file mode 100644 index 0000000..e217187 Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/jackson-databind-2.5.3.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/jackson-mapper-asl-1.9.9.jar b/de.weingardt.mylyn.gitlab.core/lib/jackson-mapper-asl-1.9.9.jar deleted file mode 100644 index 55c990b..0000000 Binary files a/de.weingardt.mylyn.gitlab.core/lib/jackson-mapper-asl-1.9.9.jar and /dev/null differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/slf4j-api-1.8.0-beta2.jar b/de.weingardt.mylyn.gitlab.core/lib/slf4j-api-1.8.0-beta2.jar new file mode 100644 index 0000000..5fafe27 Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/slf4j-api-1.8.0-beta2.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/lib/slf4j-simple-1.8.0-beta2.jar b/de.weingardt.mylyn.gitlab.core/lib/slf4j-simple-1.8.0-beta2.jar new file mode 100644 index 0000000..8e77923 Binary files /dev/null and b/de.weingardt.mylyn.gitlab.core/lib/slf4j-simple-1.8.0-beta2.jar differ diff --git a/de.weingardt.mylyn.gitlab.core/pom.xml b/de.weingardt.mylyn.gitlab.core/pom.xml index 73b452c..57ad1b8 100644 --- a/de.weingardt.mylyn.gitlab.core/pom.xml +++ b/de.weingardt.mylyn.gitlab.core/pom.xml @@ -6,7 +6,7 @@ ../pom.xml de.weingardt.mylyn.gitlab de.weingardt.mylyn.gitlab-parent - 1.6.0 + 1.6.1 de.weingardt.mylyn.gitlab.core diff --git a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/ConnectionManager.java b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/ConnectionManager.java index fab78e5..47b3daf 100644 --- a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/ConnectionManager.java +++ b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/ConnectionManager.java @@ -1,7 +1,6 @@ package de.weingardt.mylyn.gitlab.core; import java.util.HashMap; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -16,160 +15,176 @@ import de.weingardt.mylyn.gitlab.core.exceptions.UnknownProjectException; /** - * The ConnectionManager is a singleton that handles all - * GitlabConnection instances in a HashMap. The key in this HashMap - * is the URL to the Gitlab instance constructed using a TaskRepository + * The ConnectionManager is a singleton that handles all GitlabConnection instances in a HashMap. + * The key in this HashMap is the URL to the Gitlab instance constructed using a TaskRepository * class. - * @author paul * + * @author paul */ public class ConnectionManager { - /** - * The HashMap used to store all GitlabConnections - */ - private static HashMap connections = new HashMap(); - - /** - * The pattern is used to verify a ULR to a valid Gitlab project URL. - */ - private static Pattern URLPattern = Pattern.compile("((?:http|https)://(?:[^\\/]*))/((?:.*?)/(?:[^\\/]*?))$"); - - /** - * Returns the GitlabConnection for the given task repository - * @param repository - * @return - * @throws GitlabException - */ - static public GitlabConnection get(TaskRepository repository) throws GitlabException { - return get(repository, false); - } - - /** - * Returns the GitlabConnection for the given task repository. If it - * failes for whatever reason, it returns null. - * @param repository - * @return - */ - static public GitlabConnection getSafe(TaskRepository repository) { - try { - return get(repository); - } catch (GitlabException e) { - return null; - } - } - - /** - * Constructs a URL string for the given task repository. - * @param repository - * @return - */ - private static String constructURL(TaskRepository repository) { - String username = repository.getCredentials(AuthenticationType.REPOSITORY).getUserName(); - String password = repository.getCredentials(AuthenticationType.REPOSITORY).getPassword(); - return repository.getUrl() + "?username=" + username + "&password=" + password.hashCode(); - } - - /** - * Validates the given task repository and returns a GitlabConnection if - * the task repository is a valid repository. - * @param repository - * @return - * @throws GitlabException - */ - static GitlabConnection validate(TaskRepository repository) throws GitlabException { - try { - String projectPath = null; - String host = null; - - if(repository.getProperty("gitlabBaseUrl").trim().length() > 0) { - host = repository.getProperty("gitlabBaseUrl").trim(); - if(!repository.getUrl().startsWith(host)) { - throw new GitlabException("Invalid project URL!"); - } - - projectPath = repository.getUrl().replaceFirst(Matcher.quoteReplacement(host), ""); - if(projectPath.startsWith("/")) { - projectPath = projectPath.substring(1); - } - } else { - Matcher matcher = URLPattern.matcher(repository.getUrl()); - if(!matcher.find()) { - throw new GitlabException("Invalid Project-URL!"); - } - - projectPath = matcher.group(2); - host = matcher.group(1); - } - - String username = repository.getCredentials(AuthenticationType.REPOSITORY).getUserName(); - String password= repository.getCredentials(AuthenticationType.REPOSITORY).getPassword(); - - GitlabSession session = null; - String token = null; - - if(repository.getProperty("usePrivateToken") != null && repository.getProperty("usePrivateToken").equals("true")) { - session = GitlabAPI.connect(host, password).getCurrentSession(); - token = password; - } else { - session = GitlabAPI.connect(host, username, password); - token = session.getPrivateToken(); - } - - GitlabAPI api = GitlabAPI.connect(host, token); - - if(projectPath.endsWith(".git")) { - projectPath = projectPath.substring(0, projectPath.length() - 4); - } - - List projects = api.getProjects(); - for(GitlabProject p : projects) { - if(p.getPathWithNamespace().equals(projectPath)) { - GitlabConnection connection = new GitlabConnection(host, p, token, - new GitlabAttributeMapper(repository)); - return connection; - } - } - // At this point the authentication was successful, but the corresponding project - // could not be found! - throw new UnknownProjectException(projectPath); - } catch(GitlabException e) { - throw e; - } catch(Exception e) { - throw GitlabExceptionHandler.handle(e); - } catch(Error e) { - throw GitlabExceptionHandler.handle(e); - } - } - - /** - * Returns a *valid* GitlabConnection, otherwise this method throws an exception. - * @param repository - * @param forceUpdate if true, a new GitlabConnection instance will be created, even if a Gitlab - * Connection already exists for the given task repository - * @return - * @throws GitlabException - */ - static GitlabConnection get(TaskRepository repository, boolean forceUpdate) throws GitlabException { - try { - String hash = constructURL(repository); - if(connections.containsKey(hash) && !forceUpdate) { - return connections.get(hash); - } else { - GitlabConnection connection = validate(repository); - - connections.put(hash, connection); - connection.update(); - - return connection; - } - } catch(GitlabException e) { - throw e; - } catch(Exception e) { - throw GitlabExceptionHandler.handle(e); - } catch(Error e) { - throw GitlabExceptionHandler.handle(e); - } - } + /** + * The HashMap used to store all GitlabConnections + */ + private static HashMap connections = + new HashMap<>(); + + /** + * The pattern is used to verify a ULR to a valid Gitlab project URL. + */ + private static Pattern URLPattern = + Pattern.compile("((?:http|https)://(?:[^\\/]*))/((?:.*?)/(?:[^\\/]*?))$"); + + /** + * Constructs a URL string for the given task repository. + * + * @param repository + * @return + */ + private static String constructURL(TaskRepository repository) { + final String username = + repository.getCredentials(AuthenticationType.REPOSITORY).getUserName(); + final String password = + repository.getCredentials(AuthenticationType.REPOSITORY).getPassword(); + return repository.getUrl() + "?username=" + username + "&password=" + password.hashCode(); + } + + /** + * Returns the GitlabConnection for the given task repository + * + * @param repository + * @return + * @throws GitlabException + */ + static public GitlabConnection get(TaskRepository repository) throws GitlabException { + return get(repository, false); + } + + /** + * Returns a *valid* GitlabConnection, otherwise this method throws an exception. + * + * @param repository + * @param forceUpdate if true, a new GitlabConnection instance will be created, even if a Gitlab + * Connection already exists for the given task repository + * @return + * @throws GitlabException + */ + static GitlabConnection get(TaskRepository repository, boolean forceUpdate) + throws GitlabException { + try { + final String hash = constructURL(repository); + if (connections.containsKey(hash) && !forceUpdate) { + return connections.get(hash); + } else { + final GitlabConnection connection = validate(repository); + + connections.put(hash, connection); + connection.update(); + + return connection; + } + } catch (final GitlabException e) { + throw e; + } catch (final Exception e) { + throw GitlabExceptionHandler.handle(e); + } catch (final Error e) { + throw GitlabExceptionHandler.handle(e); + } + } + + /** + * Returns the GitlabConnection for the given task repository. If it failes for whatever reason, + * it returns null. + * + * @param repository + * @return + */ + static public GitlabConnection getSafe(TaskRepository repository) { + try { + return get(repository); + } catch (final GitlabException e) { + return null; + } + } + + /** + * Validates the given task repository and returns a GitlabConnection if the task repository is a + * valid repository. + * + * @param repository + * @return + * @throws GitlabException + */ + static GitlabConnection validate(TaskRepository repository) throws GitlabException { + try { + String projectPath = null; + String host = null; + + if (repository.getProperty("gitlabBaseUrl").trim().length() > 0) { + host = repository.getProperty("gitlabBaseUrl").trim(); + if (!repository.getUrl().startsWith(host)) { + throw new GitlabException("Invalid project URL!"); + } + + projectPath = repository.getUrl().replaceFirst(Matcher.quoteReplacement(host), ""); + if (projectPath.startsWith("/")) { + projectPath = projectPath.substring(1); + } + } else { + final Matcher matcher = URLPattern.matcher(repository.getUrl()); + if (!matcher.find()) { + throw new GitlabException("Invalid Project-URL!"); + } + + projectPath = matcher.group(2); + host = matcher.group(1); + } + + final String username = + repository.getCredentials(AuthenticationType.REPOSITORY).getUserName(); + final String password = + repository.getCredentials(AuthenticationType.REPOSITORY).getPassword(); + + GitlabSession session = null; + String token = null; + + if (repository.getProperty("usePrivateToken") != null + && repository.getProperty("usePrivateToken").equals("true")) { + session = GitlabAPI.connect(host, password).getCurrentSession(); + token = password; + } else { + session = GitlabAPI.connect(host, username, password); + token = session.getPrivateToken(); + } + + final GitlabAPI api = GitlabAPI.connect(host, token); + + if (projectPath.endsWith(".git")) { + projectPath = projectPath.substring(0, projectPath.length() - 4); + } + + final int projectSeparatorIdx = projectPath.lastIndexOf('/'); + final String namespace = projectPath.substring(0, projectSeparatorIdx); + final String projectName = projectPath.substring(projectSeparatorIdx + 1); + + final GitlabProject project = api.getProject(namespace, projectName); + + if (null != project) { + final GitlabConnection connection = new GitlabConnection(host, project, token, + new GitlabAttributeMapper(repository)); + return connection; + } + + // At this point the authentication was successful, but the corresponding project + // could not be found! + throw new UnknownProjectException(projectPath); + } catch (final GitlabException e) { + throw e; + } catch (final Exception e) { + throw GitlabExceptionHandler.handle(e); + } catch (final Error e) { + throw GitlabExceptionHandler.handle(e); + } + } } diff --git a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabAction.java b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabAction.java index b62da38..110e515 100644 --- a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabAction.java +++ b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabAction.java @@ -51,7 +51,7 @@ private GitlabAction(String label) { * @return */ public static GitlabAction[] getActions(GitlabIssue issue) { - if(issue.getState().equals(GitlabIssue.StateClosed)) { + if(issue.getState().equals(GitlabIssue.STATE_CLOSED)) { return closed; } else { return opened; diff --git a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabIssueSearch.java b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabIssueSearch.java index ef2386f..3d75ff9 100644 --- a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabIssueSearch.java +++ b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabIssueSearch.java @@ -71,11 +71,11 @@ public boolean doesMatch(GitlabIssue issue) { return false; } - if(!closed && issue.getState().equals(GitlabIssue.StateClosed)) { + if(!closed && issue.getState().equals(GitlabIssue.STATE_CLOSED)) { return false; } - if(!opened && issue.getState().equals(GitlabIssue.StateOpened)) { + if(!opened && issue.getState().equals(GitlabIssue.STATE_OPENED)) { return false; } diff --git a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabTaskDataHandler.java b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabTaskDataHandler.java index 09d0f6f..8040b0d 100644 --- a/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabTaskDataHandler.java +++ b/de.weingardt.mylyn.gitlab.core/src/de/weingardt/mylyn/gitlab/core/GitlabTaskDataHandler.java @@ -1,16 +1,10 @@ /******************************************************************************* - * Copyright (c) 2014, Paul Weingardt - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Paul Weingardt - initial API and implementation + * Copyright (c) 2014, Paul Weingardt All rights reserved. This program and the accompanying + * materials are made available under the terms of the Eclipse Public License v1.0 which accompanies + * this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: + * Paul Weingardt - initial API and implementation *******************************************************************************/ - - package de.weingardt.mylyn.gitlab.core; import java.io.IOException; @@ -48,256 +42,277 @@ /** * Handles the issues. It maps the attributes from the GitlabAPI to real Mylyn issue attributes, * downloads the issues for a specific task repository, and creates new issues. - * @author paul * + * @author paul */ public class GitlabTaskDataHandler extends AbstractTaskDataHandler { - private static Pattern priorityPattern = Pattern.compile("(?:priority:)?(high|normal|low)"); - private static Pattern typePattern = Pattern.compile("(?:type:)?(bug|feature|story)"); - - public GitlabTaskDataHandler() { - } - - @Override - public TaskAttributeMapper getAttributeMapper(TaskRepository repository) { - try { - return ConnectionManager.get(repository).mapper; - } catch (CoreException e) { - throw new Error(e); - } - } - - @Override - public boolean initializeTaskData(TaskRepository repository, TaskData data, - ITaskMapping mapping, IProgressMonitor monitor) throws CoreException { - createDefaultAttributes(data, false); - - GitlabConnection connection = ConnectionManager.get(repository); - TaskAttribute root = data.getRoot(); - - root.getAttribute(GitlabAttribute.PROJECT.getTaskKey()).setValue(connection.project.getName()); - root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).setValue(""); - root.getAttribute(GitlabAttribute.STATUS.getTaskKey()).setValue("open"); - root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).setValue(""); - - return true; - } - - @Override - public RepositoryResponse postTaskData(TaskRepository repository, TaskData data, - Set attributes, IProgressMonitor monitor) - throws CoreException { - - GitlabAttributeMapper attributeMapper = (GitlabAttributeMapper) data.getAttributeMapper(); - - TaskAttribute root = data.getRoot(); - String labels = root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).getValue(); - String title = root.getAttribute(GitlabAttribute.TITLE.getTaskKey()).getValue(); - String body = root.getAttribute(GitlabAttribute.BODY.getTaskKey()).getValue(); - - Integer assigneeId = 0; - - // We have to check, if the assignee has changed. The gitlab api leaves three posiblities for the assignee ID: - // 0: leave as it is - // -1: unassign - // real id: assign - // If we didnt do this, Gitlab would create a comment everytime we edit the issue and there is still no - // assignee - for(TaskAttribute a : attributes) { - if(a.getId().equals(GitlabAttribute.ASSIGNEE.getTaskKey())) { - GitlabProjectMember assignee = attributeMapper.findProjectMemberByName( - root.getAttribute(GitlabAttribute.ASSIGNEE.getTaskKey()).getValue()); - assigneeId = (assignee == null ? -1 : assignee.getId()); - } - } - - GitlabMilestone milestone = attributeMapper.findMilestoneByName( - root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).getValue()); - Integer milestoneId = (milestone == null ? 0 : milestone.getId()); - - GitlabConnection connection = ConnectionManager.get(repository); - GitlabAPI api = connection.api(); - - try { - monitor.beginTask("Uploading task", IProgressMonitor.UNKNOWN); - GitlabIssue issue = null; - if(data.isNew()) { - issue = api.createIssue(connection.project.getId(), assigneeId, milestoneId, labels, body, title); - return new RepositoryResponse(ResponseKind.TASK_CREATED, "" + issue.getId()); - } else { - - if(root.getAttribute(TaskAttribute.COMMENT_NEW) != null && - !root.getAttribute(TaskAttribute.COMMENT_NEW).getValue().equals("")) { - api.createNote(connection.project.getId(), GitlabConnector.getTicketId(data.getTaskId()), - root.getAttribute(TaskAttribute.COMMENT_NEW).getValue()); - } - - String action = root.getAttribute(TaskAttribute.OPERATION).getValue(); - - issue = api.editIssue(connection.project.getId(), GitlabConnector.getTicketId(data.getTaskId()), assigneeId, - milestoneId, labels, body, title, GitlabAction.find(action).getGitlabIssueAction()); - return new RepositoryResponse(ResponseKind.TASK_UPDATED, "" + issue.getId()); - } - } catch (IOException e) { - throw new GitlabException("Unknown connection error!"); - } finally { - monitor.done(); - } - } - - public TaskData downloadTaskData(TaskRepository repository, Integer ticketId) throws CoreException { - try { - GitlabConnection connection = ConnectionManager.get(repository); - GitlabAPI api = connection.api(); - GitlabIssue issue = api.getIssue(connection.project.getId(), ticketId); - List notes = api.getNotes(issue); - - return createTaskDataFromGitlabIssue(issue, repository, notes); - } catch (IOException e) { - throw new GitlabException("Unknown connection error!"); - } - } - - public TaskData createTaskDataFromGitlabIssue(GitlabIssue issue, TaskRepository repository, - List notes) throws CoreException { - GitlabConnection connection = ConnectionManager.get(repository); - TaskData data = new TaskData(connection.mapper, GitlabPluginCore.CONNECTOR_KIND, repository.getUrl(), - "" + issue.getId()); - - String labels = StringUtils.join(issue.getLabels(), ", "); - - createDefaultAttributes(data, true); - - TaskAttribute root = data.getRoot(); - root.getAttribute(GitlabAttribute.AUTHOR.getTaskKey()).setValue(issue.getAuthor().getName()); - root.getAttribute(GitlabAttribute.CREATED.getTaskKey()).setValue("" + issue.getCreatedAt().getTime()); - root.getAttribute(GitlabAttribute.BODY.getTaskKey()).setValue(issue.getDescription() == null ? "" : issue.getDescription()); - root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).setValue(labels); - root.getAttribute(GitlabAttribute.PROJECT.getTaskKey()).setValue(connection.project.getName()); - root.getAttribute(GitlabAttribute.STATUS.getTaskKey()).setValue(issue.getState()); - root.getAttribute(GitlabAttribute.TITLE.getTaskKey()).setValue(issue.getTitle()); - - root.getAttribute(GitlabAttribute.IID.getTaskKey()).setValue("" + issue.getIid()); - root.getAttribute(GitlabAttribute.PRIORITY.getTaskKey()).setValue(getPriority(labels)); - root.getAttribute(GitlabAttribute.TYPE.getTaskKey()).setValue(getType(labels)); - - if(issue.getMilestone() != null) { - root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).setValue(issue.getMilestone().getTitle()); - } - - if(issue.getUpdatedAt() != null) { - root.getAttribute(GitlabAttribute.UPDATED.getTaskKey()).setValue("" + issue.getUpdatedAt().getTime()); - } - - if(issue.getState().equals(GitlabIssue.StateClosed)) { - root.getAttribute(GitlabAttribute.COMPLETED.getTaskKey()).setValue("" + issue.getUpdatedAt().getTime()); - } - - if(issue.getAssignee() != null) { - root.getAttribute(GitlabAttribute.ASSIGNEE.getTaskKey()).setValue(issue.getAssignee().getName()); - } - - Collections.sort(notes, new Comparator() { - @Override - public int compare(GitlabNote o1, GitlabNote o2) { - return o1.getCreatedAt().compareTo(o2.getCreatedAt()); - } - }); - - for (int i = 0; i < notes.size(); i++) { - TaskCommentMapper cmapper = new TaskCommentMapper(); - cmapper.setAuthor(repository.createPerson(notes.get(i).getAuthor().getName())); - cmapper.setCreationDate(notes.get(i).getCreatedAt()); - cmapper.setText(notes.get(i).getBody()); - cmapper.setNumber(i + 1); - TaskAttribute attribute = data.getRoot().createAttribute(TaskAttribute.PREFIX_COMMENT + (i + 1)); - cmapper.applyTo(attribute); - } - - GitlabAction[] actions = GitlabAction.getActions(issue); - for(int i = 0; i < actions.length; ++i) { - GitlabAction action = actions[i]; - TaskAttribute attribute = data.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + action.label); - TaskOperation.applyTo(attribute, action.label, action.label); - } - - return data; - } - - private void createDefaultAttributes(TaskData data, boolean existingTask) { - createAttribute(data, GitlabAttribute.BODY); - createAttribute(data, GitlabAttribute.TITLE); - createAttribute(data, GitlabAttribute.LABELS); - createAttribute(data, GitlabAttribute.STATUS); - createAttribute(data, GitlabAttribute.PROJECT); - - createAttribute(data, GitlabAttribute.CREATED); - createAttribute(data, GitlabAttribute.COMPLETED); - createAttribute(data, GitlabAttribute.UPDATED); - createAttribute(data, GitlabAttribute.ASSIGNEE); - createAttribute(data, GitlabAttribute.MILESTONE); - - createAttribute(data, GitlabAttribute.IID); - createAttribute(data, GitlabAttribute.PRIORITY); - createAttribute(data, GitlabAttribute.TYPE); - - data.getRoot().getAttribute(GitlabAttribute.CREATED.getTaskKey()).setValue("" + (new Date().getTime())); - - if(existingTask) { - data.getRoot().createAttribute(TaskAttribute.COMMENT_NEW) - .getMetaData().setType(TaskAttribute.TYPE_LONG_RICH_TEXT) - .setReadOnly(false); - - createAttribute(data, GitlabAttribute.AUTHOR); - } - - TaskAttribute operation = data.getRoot().createAttribute(TaskAttribute.OPERATION); - operation.getMetaData().setType(TaskAttribute.TYPE_OPERATION); - } - - private void createAttribute(TaskData data, GitlabAttribute attribute) { - TaskAttribute attr = data.getRoot().createAttribute(attribute.getTaskKey()); - TaskAttributeMetaData metaData = attr.getMetaData(); - metaData.setType(attribute.getType()); - metaData.setKind(attribute.getKind()); - metaData.setLabel(attribute.toString()); - metaData.setReadOnly(attribute.isReadOnly()); - } - - /** - * Returns the Priority String for Mylyn. Uses a regular expression to check - * for priorities in the given label. - * @param labels - * @return - */ - private String getPriority(String labels) { - Matcher m = priorityPattern.matcher(labels); - if(m.find()) { - String p = m.group(1); - if(p.equals("high")) { - return PriorityLevel.P1.toString(); - } else if(p.equals("low")) { - return PriorityLevel.P5.toString(); - } - } - - return PriorityLevel.P3.toString(); - } - - /** - * Returns the type string for Mylyn. Uses a regular expression to check - * for types in the given label. - * @param labels - * @return - */ - private String getType(String labels) { - Matcher m = typePattern.matcher(labels); - if(m.find()) { - return m.group(1); - } - - return ""; - } + private static Pattern priorityPattern = Pattern.compile("(?:priority:)?(high|normal|low)"); + + private static Pattern typePattern = Pattern.compile("(?:type:)?(bug|feature|story)"); + + public GitlabTaskDataHandler() {} + + private void createAttribute(TaskData data, GitlabAttribute attribute) { + final TaskAttribute attr = data.getRoot().createAttribute(attribute.getTaskKey()); + final TaskAttributeMetaData metaData = attr.getMetaData(); + metaData.setType(attribute.getType()); + metaData.setKind(attribute.getKind()); + metaData.setLabel(attribute.toString()); + metaData.setReadOnly(attribute.isReadOnly()); + } + + private void createDefaultAttributes(TaskData data, boolean existingTask) { + createAttribute(data, GitlabAttribute.BODY); + createAttribute(data, GitlabAttribute.TITLE); + createAttribute(data, GitlabAttribute.LABELS); + createAttribute(data, GitlabAttribute.STATUS); + createAttribute(data, GitlabAttribute.PROJECT); + + createAttribute(data, GitlabAttribute.CREATED); + createAttribute(data, GitlabAttribute.COMPLETED); + createAttribute(data, GitlabAttribute.UPDATED); + createAttribute(data, GitlabAttribute.ASSIGNEE); + createAttribute(data, GitlabAttribute.MILESTONE); + + createAttribute(data, GitlabAttribute.IID); + createAttribute(data, GitlabAttribute.PRIORITY); + createAttribute(data, GitlabAttribute.TYPE); + + data.getRoot().getAttribute(GitlabAttribute.CREATED.getTaskKey()) + .setValue("" + new Date().getTime()); + + if (existingTask) { + data.getRoot().createAttribute(TaskAttribute.COMMENT_NEW) + .getMetaData().setType(TaskAttribute.TYPE_LONG_RICH_TEXT) + .setReadOnly(false); + + createAttribute(data, GitlabAttribute.AUTHOR); + } + + final TaskAttribute operation = data.getRoot().createAttribute(TaskAttribute.OPERATION); + operation.getMetaData().setType(TaskAttribute.TYPE_OPERATION); + } + + public TaskData createTaskDataFromGitlabIssue(GitlabIssue issue, TaskRepository repository, + List notes) throws CoreException { + final GitlabConnection connection = ConnectionManager.get(repository); + final TaskData data = + new TaskData(connection.mapper, GitlabPluginCore.CONNECTOR_KIND, repository.getUrl(), + "" + issue.getIid()); + + final String labels = StringUtils.join(issue.getLabels(), ", "); + + createDefaultAttributes(data, true); + + final TaskAttribute root = data.getRoot(); + root.getAttribute(GitlabAttribute.AUTHOR.getTaskKey()) + .setValue(issue.getAuthor().getName()); + root.getAttribute(GitlabAttribute.CREATED.getTaskKey()) + .setValue("" + issue.getCreatedAt().getTime()); + root.getAttribute(GitlabAttribute.BODY.getTaskKey()) + .setValue(issue.getDescription() == null ? "" : issue.getDescription()); + root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).setValue(labels); + root.getAttribute(GitlabAttribute.PROJECT.getTaskKey()) + .setValue(connection.project.getName()); + root.getAttribute(GitlabAttribute.STATUS.getTaskKey()).setValue(issue.getState()); + root.getAttribute(GitlabAttribute.TITLE.getTaskKey()).setValue(issue.getTitle()); + + root.getAttribute(GitlabAttribute.IID.getTaskKey()).setValue("" + issue.getIid()); + root.getAttribute(GitlabAttribute.PRIORITY.getTaskKey()).setValue(getPriority(labels)); + root.getAttribute(GitlabAttribute.TYPE.getTaskKey()).setValue(getType(labels)); + + if (issue.getMilestone() != null) { + root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()) + .setValue(issue.getMilestone().getTitle()); + } + + if (issue.getUpdatedAt() != null) { + root.getAttribute(GitlabAttribute.UPDATED.getTaskKey()) + .setValue("" + issue.getUpdatedAt().getTime()); + } + + if (issue.getState().equals(GitlabIssue.STATE_CLOSED)) { + root.getAttribute(GitlabAttribute.COMPLETED.getTaskKey()) + .setValue("" + issue.getUpdatedAt().getTime()); + } + + if (issue.getAssignee() != null) { + root.getAttribute(GitlabAttribute.ASSIGNEE.getTaskKey()) + .setValue(issue.getAssignee().getName()); + } + + Collections.sort(notes, new Comparator() { + @Override + public int compare(GitlabNote o1, GitlabNote o2) { + return o1.getCreatedAt().compareTo(o2.getCreatedAt()); + } + }); + + for (int i = 0; i < notes.size(); i++) { + final TaskCommentMapper cmapper = new TaskCommentMapper(); + cmapper.setAuthor(repository.createPerson(notes.get(i).getAuthor().getName())); + cmapper.setCreationDate(notes.get(i).getCreatedAt()); + cmapper.setText(notes.get(i).getBody()); + cmapper.setNumber(i + 1); + final TaskAttribute attribute = + data.getRoot().createAttribute(TaskAttribute.PREFIX_COMMENT + (i + 1)); + cmapper.applyTo(attribute); + } + + final GitlabAction[] actions = GitlabAction.getActions(issue); + for (final GitlabAction action : actions) { + final TaskAttribute attribute = + data.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + action.label); + TaskOperation.applyTo(attribute, action.label, action.label); + } + + return data; + } + + public TaskData downloadTaskData(TaskRepository repository, Integer ticketId) + throws CoreException { + try { + final GitlabConnection connection = ConnectionManager.get(repository); + final GitlabAPI api = connection.api(); + final GitlabIssue issue = api.getIssue(connection.project.getId(), ticketId); + final List notes = api.getNotes(issue); + + return createTaskDataFromGitlabIssue(issue, repository, notes); + } catch (final IOException e) { + throw new GitlabException("Unknown connection error!"); + } + } + + @Override + public TaskAttributeMapper getAttributeMapper(TaskRepository repository) { + try { + return ConnectionManager.get(repository).mapper; + } catch (final CoreException e) { + throw new Error(e); + } + } + + /** + * Returns the Priority String for Mylyn. Uses a regular expression to check for priorities in the + * given label. + * + * @param labels + * @return + */ + private String getPriority(String labels) { + final Matcher m = priorityPattern.matcher(labels); + if (m.find()) { + final String p = m.group(1); + if (p.equals("high")) { + return PriorityLevel.P1.toString(); + } else if (p.equals("low")) { + return PriorityLevel.P5.toString(); + } + } + + return PriorityLevel.P3.toString(); + } + + /** + * Returns the type string for Mylyn. Uses a regular expression to check for types in the given + * label. + * + * @param labels + * @return + */ + private String getType(String labels) { + final Matcher m = typePattern.matcher(labels); + if (m.find()) { + return m.group(1); + } + + return ""; + } + + @Override + public boolean initializeTaskData(TaskRepository repository, TaskData data, + ITaskMapping mapping, IProgressMonitor monitor) throws CoreException { + createDefaultAttributes(data, false); + + final GitlabConnection connection = ConnectionManager.get(repository); + final TaskAttribute root = data.getRoot(); + + root.getAttribute(GitlabAttribute.PROJECT.getTaskKey()) + .setValue(connection.project.getName()); + root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).setValue(""); + root.getAttribute(GitlabAttribute.STATUS.getTaskKey()).setValue("open"); + root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).setValue(""); + + return true; + } + + @Override + public RepositoryResponse postTaskData(TaskRepository repository, TaskData data, + Set attributes, IProgressMonitor monitor) + throws CoreException { + + final GitlabAttributeMapper attributeMapper = + (GitlabAttributeMapper) data.getAttributeMapper(); + + final TaskAttribute root = data.getRoot(); + final String labels = root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).getValue(); + final String title = root.getAttribute(GitlabAttribute.TITLE.getTaskKey()).getValue(); + final String body = root.getAttribute(GitlabAttribute.BODY.getTaskKey()).getValue(); + + Integer assigneeId = 0; + + // We have to check, if the assignee has changed. The gitlab api leaves three posiblities for + // the assignee ID: + // 0: leave as it is + // -1: unassign + // real id: assign + // If we didnt do this, Gitlab would create a comment everytime we edit the issue and there is + // still no + // assignee + for (final TaskAttribute a : attributes) { + if (a.getId().equals(GitlabAttribute.ASSIGNEE.getTaskKey())) { + final GitlabProjectMember assignee = attributeMapper.findProjectMemberByName( + root.getAttribute(GitlabAttribute.ASSIGNEE.getTaskKey()).getValue()); + assigneeId = assignee == null ? -1 : assignee.getId(); + } + } + + final GitlabMilestone milestone = attributeMapper.findMilestoneByName( + root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).getValue()); + final Integer milestoneId = milestone == null ? 0 : milestone.getId(); + + final GitlabConnection connection = ConnectionManager.get(repository); + final GitlabAPI api = connection.api(); + + try { + monitor.beginTask("Uploading task", IProgressMonitor.UNKNOWN); + GitlabIssue issue = null; + if (data.isNew()) { + issue = api.createIssue(connection.project.getId(), assigneeId, milestoneId, labels, + body, title); + return new RepositoryResponse(ResponseKind.TASK_CREATED, "" + issue.getIid()); + } else { + + if (root.getAttribute(TaskAttribute.COMMENT_NEW) != null && + !root.getAttribute(TaskAttribute.COMMENT_NEW).getValue().equals("")) { + api.createNote(connection.project.getId(), + GitlabConnector.getTicketId(data.getTaskId()), + root.getAttribute(TaskAttribute.COMMENT_NEW).getValue()); + } + + final String action = root.getAttribute(TaskAttribute.OPERATION).getValue(); + + issue = api.editIssue(connection.project.getId(), + GitlabConnector.getTicketId(data.getTaskId()), assigneeId, + milestoneId, labels, body, title, GitlabAction.find(action).getGitlabIssueAction()); + return new RepositoryResponse(ResponseKind.TASK_UPDATED, "" + issue.getIid()); + } + } catch (final IOException e) { + throw new GitlabException("Unknown connection error!"); + } finally { + monitor.done(); + } + } } diff --git a/de.weingardt.mylyn.gitlab.ui/META-INF/MANIFEST.MF b/de.weingardt.mylyn.gitlab.ui/META-INF/MANIFEST.MF index dd7a2b8..d714b8f 100644 --- a/de.weingardt.mylyn.gitlab.ui/META-INF/MANIFEST.MF +++ b/de.weingardt.mylyn.gitlab.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Mylyn Gitlab Connector UI Bundle-SymbolicName: de.weingardt.mylyn.gitlab.ui;singleton:=true -Bundle-Version: 1.6.0 +Bundle-Version: 1.6.1 Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui, diff --git a/de.weingardt.mylyn.gitlab.ui/pom.xml b/de.weingardt.mylyn.gitlab.ui/pom.xml index 9e8796f..3295b5d 100644 --- a/de.weingardt.mylyn.gitlab.ui/pom.xml +++ b/de.weingardt.mylyn.gitlab.ui/pom.xml @@ -5,7 +5,7 @@ ../pom.xml de.weingardt.mylyn.gitlab de.weingardt.mylyn.gitlab-parent - 1.6.0 + 1.6.1 de.weingardt.mylyn.gitlab.ui diff --git a/de.weingardt.mylyn.gitlab.ui/src/de/weingardt/mylyn/gitlab/ui/GitlabQueryPage.java b/de.weingardt.mylyn.gitlab.ui/src/de/weingardt/mylyn/gitlab/ui/GitlabQueryPage.java index 184bd13..9ed1f7d 100644 --- a/de.weingardt.mylyn.gitlab.ui/src/de/weingardt/mylyn/gitlab/ui/GitlabQueryPage.java +++ b/de.weingardt.mylyn.gitlab.ui/src/de/weingardt/mylyn/gitlab/ui/GitlabQueryPage.java @@ -187,12 +187,12 @@ private void createOptionsArea(Composite parent) { openButton = new Button(statusArea, SWT.CHECK); openButton.setSelection(true); - openButton.setText(GitlabIssue.StateOpened); + openButton.setText(GitlabIssue.STATE_OPENED); openButton.addSelectionListener(completeListener); closedButton = new Button(statusArea, SWT.CHECK); closedButton.setSelection(true); - closedButton.setText(GitlabIssue.StateClosed); + closedButton.setText(GitlabIssue.STATE_CLOSED); closedButton.addSelectionListener(completeListener); Label milestonesLabel = new Label(optionsArea, SWT.NONE); diff --git a/de.weingardt.mylyn.gitlab.updatesite/category.xml b/de.weingardt.mylyn.gitlab.updatesite/category.xml index 3ce6320..09aee9d 100644 --- a/de.weingardt.mylyn.gitlab.updatesite/category.xml +++ b/de.weingardt.mylyn.gitlab.updatesite/category.xml @@ -1,6 +1,6 @@ - + diff --git a/de.weingardt.mylyn.gitlab.updatesite/pom.xml b/de.weingardt.mylyn.gitlab.updatesite/pom.xml index 320c73a..c145a8b 100644 --- a/de.weingardt.mylyn.gitlab.updatesite/pom.xml +++ b/de.weingardt.mylyn.gitlab.updatesite/pom.xml @@ -5,7 +5,7 @@ ../pom.xml de.weingardt.mylyn.gitlab de.weingardt.mylyn.gitlab-parent - 1.6.0 + 1.6.1 de.weingardt.mylyn.gitlab.updatesite diff --git a/de.weingardt.mylyn.gitlab/feature.xml b/de.weingardt.mylyn.gitlab/feature.xml index 4fcf2e6..bf84949 100644 --- a/de.weingardt.mylyn.gitlab/feature.xml +++ b/de.weingardt.mylyn.gitlab/feature.xml @@ -2,7 +2,7 @@ @@ -21,14 +21,14 @@ id="de.weingardt.mylyn.gitlab.core" download-size="0" install-size="0" - version="1.6.0" + version="1.6.1" unpack="false"/> diff --git a/de.weingardt.mylyn.gitlab/pom.xml b/de.weingardt.mylyn.gitlab/pom.xml index 485f828..d41a207 100644 --- a/de.weingardt.mylyn.gitlab/pom.xml +++ b/de.weingardt.mylyn.gitlab/pom.xml @@ -6,7 +6,7 @@ ../pom.xml de.weingardt.mylyn.gitlab de.weingardt.mylyn.gitlab-parent - 1.6.0 + 1.6.1 de.weingardt.mylyn.gitlab diff --git a/pom.xml b/pom.xml index 0f22847..e7ab320 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.weingardt.mylyn.gitlab de.weingardt.mylyn.gitlab-parent - 1.6.0 + 1.6.1 pom