diff --git a/LICENSE.txt b/LICENSE.txt index 86cb57f..81b442c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -57,19 +57,23 @@ commons-codec-1.15.jar Copyrights: Copyright: Copyright The Apache Software Foundation - Reference: https://commons.apache.org/ + Reference: null + Author: The Apache Software Foundation -commons-io-2.11.0.jar +commons-io-2.17.0.jar Licenses: License: Apache 2.0 - Reference: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.11.0/commons-io-2.11.0.pom + Reference: https://repo.maven.apache.org/maven2/commons-io/commons-io/2.17.0/commons-io-2.17.0.pom LicenseText: License Text Under Appendix Copyrights: - Copyright: Copyright 2002-2021 The Apache Software Foundation - Reference: https://index.whitesourcesoftware.com/gri/app/reader/resource/content/asString/454db108-23ea-4a10-ab65-9a699dc34ab2 + Copyright: Copyright 2002-2024 The Apache Software Foundation + Reference: https://index.whitesourcesoftware.com/gri/app/reader/resource/content/asString/57a467f1-c18e-4293-807f-683b2ac78980 Author: The Apache Software Foundation + Copyright: Copyright The Apache Software Foundation + Reference: https://commons.apache.org/proper/commons-io/ + commons-lang3-3.12.0.jar Licenses: License: Apache 2.0 @@ -81,6 +85,9 @@ commons-lang3-3.12.0.jar Reference: https://index.whitesourcesoftware.com/gri/app/reader/resource/content/asString/11239b3a-f2b6-4016-bd0c-c0ce1d0fa09e Author: The Apache Software Foundation + Copyright: Copyright The Apache Software Foundation + Reference: https://commons.apache.org/proper/commons-lang/ + jsr305-3.0.2.jar Licenses: License: Apache 2.0 @@ -88,8 +95,8 @@ jsr305-3.0.2.jar LicenseText: License Text Under Appendix Copyrights: - Copyright: Copyright 2012 http://findbugs.sourceforge.net/ - Reference: University of Maryland + Copyright: Copyright (c) + Reference: null jzlib-1.1.3.jar Licenses: @@ -119,29 +126,28 @@ jzlib-1.1.3.jar ----- BSD 3 ----- -Copyright (c) {{YEAR}}, {{OWNER}} -All rights reserved. +Copyright (c) . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, this list of +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, this list of +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -Neither the name of {{the ORGANIZATION nor the names of its contributors}} may be used to -endorse or promote products derived from this software without specific prior written +3. Neither the name of the copyright holder nor the names of its contributors may be used +to endorse or promote products derived from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY {{THE COPYRIGHT HOLDERS AND CONTRIBUTORS}} "AS IS" AND ANY +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -{{THE COPYRIGHT HOLDER OR CONTRIBUTORS}} BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -150,207 +156,175 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ---------- Apache 2.0 ---------- - - 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. +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/RELEASE.md b/RELEASE.md index 5844827..9ef9c62 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,7 @@ Release Notes for P4Java, the Perforce Java API - Version 2024.1 + Version 2024.2 Introduction @@ -20,7 +20,7 @@ Introduction Requirements - * Perforce server at Release 2015.1 or higher. + * Perforce server at Release 2021.1 or higher. * Java: full standard JDK 11 or later. Implementation as discussed in "Known Limitations" below. @@ -30,7 +30,7 @@ Requirements SSL and Trust - Perforce server 2015.1 or higher supports 256-bit SSL connections + Perforce server 2021.1 or higher supports 256-bit SSL connections and trust establishment via accepting the fingerprint of the SSL certificate's public key. The standard JDK comes with 128-bit encryption level ciphers. In order to use P4Java to connect to @@ -108,7 +108,7 @@ Known Limitations mean either true shift-jis or CP932 by the Perforce server and many Windows tools. There is currently no workaround known. - * The Perforce server (2015.1 or higher) only support 256-bit + * The Perforce server (2021.1 or higher) only support 256-bit encryption. Due to current US export control restrictions for some countries, the standard JDK package only comes with 128-bit encryption level ciphers. In order to use P4Java to @@ -123,6 +123,42 @@ Known Limitations * P4Java would not support file operations on altsync enabled clients. +------------------------------------------- +Updates in 2024.2 (2024.2/2695691) (2024/12/13) + + #2693987 (Job #123372) + Fixed a bug where localWhere should include path of the sparse stream instead + of the mainline from which the sparse stream is created + + #2692452 (Job #123888) + Added 'long' value support for 'TicketExpiration' field while login + + #2693212, #2693848 (Job #123268) + Added support of P4IGNORE from env variable working for absolute path + Added support for all patterns in ignore file + + #2687877, #2686707 (Job #122068) + Added support of -m flag for "p4 protects" command + + #2684594 (Job #123229) + Added support for user case insensitive suboption for "p4 labels" command + + #2684552 (Job #122974) + Added support for user case insensitive suboption for "p4 clients" command + + #2684551 (Job #122978) + Added support for user case insensitive suboption for "p4 branches" command + + #2684163, #2685729 (Job #123231) + Added support for multiple client and user option with a generic case-insensitive + sub option for "p4 changes" command + + #2684163, #2681088 (Job #122972) + Added support for client and user case insensitive option for + "p4 changes -c and -u" + + #2684152, #2688244 (Job #121727) + Added support for Sparse Streams ------------------------------------------- Updates in 2024.1 Patch 1 (2024.1/2674354) (2024/10/29) diff --git a/build.gradle b/build.gradle index 44c11a6..606fe2f 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ dependencies { testImplementation 'org.apache.commons:commons-exec:1.3' testImplementation 'org.apache.commons:commons-compress:1.21' testImplementation 'junit:junit:4.13.1' - testImplementation 'org.mockito:mockito-core:4.0.0' + testImplementation 'org.mockito:mockito-core:5.5.0' testImplementation 'com.googlecode.java-diff-utils:diffutils:1.3.0' } diff --git a/src/main/java/com/perforce/p4java/admin/IProtectionEntry.java b/src/main/java/com/perforce/p4java/admin/IProtectionEntry.java index 9e018b9..6af23ab 100644 --- a/src/main/java/com/perforce/p4java/admin/IProtectionEntry.java +++ b/src/main/java/com/perforce/p4java/admin/IProtectionEntry.java @@ -108,4 +108,11 @@ public interface IProtectionEntry extends IMapEntry { * the path excluded indicator (true/false) */ void setPathExcluded(boolean pathExcluded); + + /** + * Returns the single word summary + * + * @return permMax + */ + String getPermMax(); } diff --git a/src/main/java/com/perforce/p4java/core/IStreamSummary.java b/src/main/java/com/perforce/p4java/core/IStreamSummary.java index 574fe32..842e671 100644 --- a/src/main/java/com/perforce/p4java/core/IStreamSummary.java +++ b/src/main/java/com/perforce/p4java/core/IStreamSummary.java @@ -21,7 +21,7 @@ public interface IStreamSummary extends IServerResource { /** * Types of streams include 'mainline', 'release', 'development', 'virtual' - * and 'task'. The default is 'development'. + * 'task', 'sparsedev' and 'sparserel'. The default is 'development'. *

* Defines the role of a stream: A 'mainline' may not have a parent. A * 'virtual' stream is not a stream but an alternate view of its parent @@ -29,10 +29,12 @@ public interface IStreamSummary extends IServerResource { * be changed. A 'task' stream is a lightweight short-lived stream that only * promotes modified content to the repository, branched data is stored in * shadow tables that are removed when the task stream is deleted or - * unloaded. + * unloaded. A 'sparsedev' stream is for development with the same flow + * control as a stream of type development and a 'sparserel' stream is for + * release with the same flow control as a stream of type release */ public enum Type { - MAINLINE, RELEASE, DEVELOPMENT, VIRTUAL, TASK, UNKNOWN; + MAINLINE, RELEASE, DEVELOPMENT, VIRTUAL, TASK, UNKNOWN, SPARSEDEV, SPARSEREL; /** * Return a suitable Stream type as inferred from the passed-in diff --git a/src/main/java/com/perforce/p4java/impl/generic/admin/ProtectionEntry.java b/src/main/java/com/perforce/p4java/impl/generic/admin/ProtectionEntry.java index 040ff2c..2ec39a8 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/admin/ProtectionEntry.java +++ b/src/main/java/com/perforce/p4java/impl/generic/admin/ProtectionEntry.java @@ -13,6 +13,7 @@ import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.HOST; import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.IS_GROUP; import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.PERM; +import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.PERM_MAX; import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.UNMAP; import static com.perforce.p4java.impl.mapbased.rpc.func.RpcFunctionMapKey.USER; import static java.util.Objects.nonNull; @@ -67,6 +68,11 @@ public class ProtectionEntry extends MapEntry implements IProtectionEntry { */ private String name = null; + /** + * If -m flag is true, a single word summary of the maximum access level is reported. + */ + private String permMax = null; + /** * Default constructor -- sets all fields to null, zero, or false. */ @@ -134,6 +140,7 @@ public ProtectionEntry(final Map map, final int order) { if (map.containsKey(UNMAP)) { type = EntryType.EXCLUDE; } + permMax = parseString(map, PERM_MAX); } } @@ -216,6 +223,12 @@ public void setPathExcluded(boolean pathExcluded) { } } + @Override + + public String getPermMax() { + return permMax; + } + /** * Add exclude ('-') to a string. If it is a double quoted string, add the * exclude immediately after the first double quote char. diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/client/cmd/WhereDelegator.java b/src/main/java/com/perforce/p4java/impl/mapbased/client/cmd/WhereDelegator.java index 608e3ff..b1c265c 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/client/cmd/WhereDelegator.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/client/cmd/WhereDelegator.java @@ -79,6 +79,10 @@ public List localWhere(List fileSpecs) { if (mt.translate(mt.get(i), MapTableT.RHS, s) != null) { String depotPath = mt.translate(mt.get(i), MapTableT.RHS, s); spec.setDepotPath(depotPath); + //Last view mapping should override all + if (spec.getDepotPath() != null) { + break; + } } } resultList.add(spec); @@ -88,6 +92,9 @@ public List localWhere(List fileSpecs) { if (mt.translate(mt.get(i), MapTableT.LHS, s) != null) { String clientPath = mt.translate(mt.get(i), MapTableT.LHS, s); spec.setClientPath(clientPath); + if (spec.getClientPath() != null) { + break; + } } } spec = clientPathToLocalPath(spec, client); @@ -98,6 +105,10 @@ public List localWhere(List fileSpecs) { if (mt.translate(mt.get(i), MapTableT.RHS, s) != null) { String depotPath = mt.translate(mt.get(i), MapTableT.RHS, s); spec.setDepotPath(depotPath); + //Last view mapping should override all + if (spec.getDepotPath() != null) { + break; + } } } spec = clientPathToLocalPath(spec, client); diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/RpcFunctionMapKey.java b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/RpcFunctionMapKey.java index 6087801..376f2e7 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/RpcFunctionMapKey.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/RpcFunctionMapKey.java @@ -118,6 +118,7 @@ public class RpcFunctionMapKey { public static final String KEY = "key"; public static final String LABEL_REC_DELETED = "labelRecDeleted"; public static final String LABEL = "label"; + public static final String LADDR = "listenAddr"; public static final String LINEEND = "LineEnd"; public static final String LOCAL_FILE = "localFile"; public static final String LOWER = "lower"; @@ -214,6 +215,7 @@ public class RpcFunctionMapKey { public static final String SERVERID = "serverID"; public static final String SERVERLICENSE = "serverLicense"; public static final String SERVERROOT = "serverRoot"; + public static final String SERVERTYPE = "serverType"; public static final String SERVERUPTIME = "serverUptime"; public static final String SERVERVERSION = "serverVersion"; public static final String SET = "set"; @@ -230,7 +232,10 @@ public class RpcFunctionMapKey { public static final String STATUS = "status"; public static final String SUBMITOPTIONS = "SubmitOptions"; public static final String SUMMARY = "summary"; + public static final String SVRID = "svrid"; public static final String SVRNAME = "svrname"; + public static final String SVRTYPE = "svrtype"; + public static final String SVRVERSION = "svrversion"; public static final String SYNCTIME = "syncTime"; public static final String TAG = "tag"; public static final String THEIRNAME = "theirName"; @@ -296,6 +301,8 @@ public class RpcFunctionMapKey { public static final String URL = "url"; + public static final String PERM_MAX = "permMax"; + /** * RPC keys map */ diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientIgnoreChecker.java b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientIgnoreChecker.java index d2332c0..4dbb492 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientIgnoreChecker.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientIgnoreChecker.java @@ -78,7 +78,8 @@ public boolean match(File file) throws FileNotFoundException, IOException { } /** - * Check all ignore files up to the client root directory. + * Check for the ignore file as an absolute path + * or check the ignore file up to the client root directory. * * @param file * the file @@ -88,23 +89,62 @@ public boolean match(File file) throws FileNotFoundException, IOException { */ private boolean checkIgnoreFiles(File file) throws IOException { if (file != null) { - // Signal for inverse match + // when ignoreFileName is in the form of absolute path + File ignoreFile = new File(ignoreFileName); + if (ignoreFile.exists() && !ignoreFileName.startsWith(".")) { + if (checkIgnorePatternInSubDirectories(ignoreFile, file)) { + return true; + } + } + // when ignoreFileName is in the form of a relative path of client root + else { + File clientRootDir = new File(clientRoot); + File fileDir = file; + do { + fileDir = fileDir.getParentFile(); + if (fileDir != null) { + ignoreFile = new File(fileDir, ignoreFileName); + if (ignoreFile.exists()) { + if (checkIgnorePatternInSubDirectories(ignoreFile, file)) { + return true; + } + } + } + } while (fileDir != null && !fileDir.getAbsoluteFile().equals(clientRootDir)); + } + } + + return false; + } + + /** + * Checks for the ignore file patterns in all the directories and sub-directories + * + * @param ignoreFile + * the ignore file + * @param file + * the file + * @return true, if successful + * @throws IOException + * Signals that an I/O exception has occurred. + */ + private boolean checkIgnorePatternInSubDirectories(File ignoreFile, File file) throws IOException { + if (file != null && ignoreFile.exists()) { + // Signal for inverse match (if negation is used in ignore rules) Negate negate = this.new Negate(); File clientRootDir = new File(clientRoot); File fileDir = file; + do { fileDir = fileDir.getParentFile(); if (fileDir != null) { - File ignoreFile = new File(fileDir, ignoreFileName); - if (ignoreFile.exists()) { - if (checkIgnoreFile(ignoreFile, fileDir, file, negate)) { - // Inverse match - if (negate.isMatch()) { - return false; - } - return true; + if (traverseIgnoreFileForPattern(ignoreFile, fileDir, file, negate)) { + // Inverse match + if (negate.isMatch()) { + return false; } + return true; } } } while (fileDir != null && !fileDir.getAbsoluteFile().equals(clientRootDir)); @@ -128,7 +168,7 @@ private boolean checkIgnoreFiles(File file) throws IOException { * @throws IOException * Signals that an I/O exception has occurred. */ - private boolean checkIgnoreFile(File ignoreFile, File currentDir, File file, Negate negate) + private boolean traverseIgnoreFileForPattern(File ignoreFile, File currentDir, File file, Negate negate) throws IOException { BufferedReader br = null; diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientUserInteraction.java b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientUserInteraction.java index 78495a6..3595fae 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientUserInteraction.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/func/client/ClientUserInteraction.java @@ -624,6 +624,9 @@ protected RpcPacketDispatcherResult clientCrypto(RpcConnection rpcConnection, Co boolean proxy = props.containsKey(RpcFunctionMapKey.IPADDR) && props.containsKey(RpcFunctionMapKey.SVRNAME) && props.containsKey(RpcFunctionMapKey.PORT); String svcUser = props.getProperty(RpcFunctionMapKey.SVRNAME); + String svrId = props.getProperty(RpcFunctionMapKey.SVRID); + String svrType = props.getProperty(RpcFunctionMapKey.SVRTYPE); + String svrVersion = props.getProperty(RpcFunctionMapKey.SVRVERSION); try { // Use the auth ticket associated with specified server address @@ -695,11 +698,10 @@ protected RpcPacketDispatcherResult clientCrypto(RpcConnection rpcConnection, Co respMap.put(RpcFunctionMapKey.TOKEN2, resp); } - if (proxy) { + if (proxy && daddr0 != null) { respMap.put(RpcFunctionMapKey.CADDR, props.getProperty(RpcFunctionMapKey.IPADDR)); - } + respMap.put(RpcFunctionMapKey.LADDR, props.getProperty(RpcFunctionMapKey.PORT)); - if (daddr0 != null) { digester.reset(); digester.update(svcUser.getBytes()); if (svcTicketStr != null) { @@ -712,6 +714,16 @@ protected RpcPacketDispatcherResult clientCrypto(RpcConnection rpcConnection, Co respMap.put("svrname0", svcUser); respMap.put(RpcFunctionMapKey.DADDR + "0", daddr0); respMap.put("dhash0", resp); + + if(svrType != null) { + respMap.put(RpcFunctionMapKey.SERVERTYPE + "0", svrType); + } + if(svrId != null) { + respMap.put(RpcFunctionMapKey.SERVERID + "0", svrId); + } + if(svrVersion != null) { + respMap.put(RpcFunctionMapKey.SERVERVERSION + "0", svrVersion); + } } RpcPacket respPacket = RpcPacket.constructRpcPacket(confirm, respMap, null); diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/server/Parameters.java b/src/main/java/com/perforce/p4java/impl/mapbased/server/Parameters.java index 81f47e2..ec6fa2d 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/server/Parameters.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/server/Parameters.java @@ -150,6 +150,54 @@ private static void addOpts(@Nonnull List args, @Nullable Options opts, } else { args.addAll(opts.processOptions(server)); } + splitSubOptions(args); + } + } + + private static void splitSubOptions(@Nullable List args) { + if (args == null) return; + + boolean clientFlag = false; + boolean userFlag = false; + + List modifiedList = new ArrayList<>(); + + for (String argItem : args) { + if(argItem == null) break; + + String[] param = argItem.split(" "); + + if (param[0].equalsIgnoreCase("--client-case-insensitive")) { + clientFlag = true; + } + else if (param[0].equalsIgnoreCase("--user-case-insensitive")) { + userFlag = true; + } + else if (param[0].startsWith("-c") && param.length>1 && (param[1].equals("-E") || param[1].equalsIgnoreCase("--client-case-insensitive"))) { + clientFlag = true; + modifiedList.add(param[0]); + } + else if (param[0].startsWith("-u") && param.length>1 && (param[1].equals("-E") || param[1].equalsIgnoreCase("--user-case-insensitive"))) { + userFlag = true; + modifiedList.add(param[0]); + } + else { + modifiedList.add(param[0]); + } + } + + if (userFlag) { + modifiedList.add("--user-case-insensitive"); + // Replace the original options with the modified list + args.clear(); + args.addAll(modifiedList); + } + + if (clientFlag) { + modifiedList.add("--client-case-insensitive"); + // Replace the original options with the modified list + args.clear(); + args.addAll(modifiedList); } } diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/server/Server.java b/src/main/java/com/perforce/p4java/impl/mapbased/server/Server.java index fef35d2..9e258a6 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/server/Server.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/server/Server.java @@ -149,6 +149,7 @@ import com.perforce.p4java.impl.mapbased.server.cmd.VerifyDelegator; import com.perforce.p4java.option.UsageOptions; import com.perforce.p4java.option.server.ChangelistOptions; +import com.perforce.p4java.option.server.ConvertSparseOptions; import com.perforce.p4java.option.server.CounterOptions; import com.perforce.p4java.option.server.DeleteBranchSpecOptions; import com.perforce.p4java.option.server.DeleteClientOptions; @@ -2470,6 +2471,13 @@ public String deleteStream(final String streamPath, final StreamOptions opts) th return streamDelegator.deleteStream(streamPath, opts); } + @Override + public String convertSparseStream(final ConvertSparseOptions opts) throws P4JavaException { + + return streamDelegator.convertSparseStream(opts); + } + + @Override public List getStreams(final List streamPaths, final GetStreamsOptions opts) throws P4JavaException { diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/LoginDelegator.java b/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/LoginDelegator.java index fe551a3..f570c6e 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/LoginDelegator.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/LoginDelegator.java @@ -55,9 +55,9 @@ public String getLoginStatus() throws P4JavaException { // therefore we must convert it here. if (firstResultMap.containsKey("TicketExpiration")) { String user = (String) firstResultMap.get("User"); - int secondsRemaining = Integer.parseInt(String.valueOf(firstResultMap.get("TicketExpiration"))); - int hoursRemaining = secondsRemaining / 3600; - int minutesRemaining = (secondsRemaining % 3600) / 60; + long secondsRemaining = Long.parseLong(String.valueOf(firstResultMap.get("TicketExpiration"))); + long hoursRemaining = secondsRemaining / 3600; + long minutesRemaining = (secondsRemaining % 3600) / 60; statusStr = "User " + user + " ticket expires in " + hoursRemaining + " hours " + minutesRemaining + " minutes."; } else { // it's probably an error message: diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/StreamDelegator.java b/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/StreamDelegator.java index dcc985a..ab9681e 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/StreamDelegator.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/server/cmd/StreamDelegator.java @@ -4,6 +4,7 @@ import static com.perforce.p4java.impl.mapbased.server.cmd.ResultListBuilder.buildNullableObjectFromNonInfoMessageCommandResultMaps; import static com.perforce.p4java.impl.mapbased.server.cmd.ResultMapParser.parseCommandResultMapIfIsInfoMessageAsString; import static com.perforce.p4java.server.CmdSpec.STREAM; +import static java.util.Objects.nonNull; import java.util.List; import java.util.Map; @@ -16,6 +17,7 @@ import com.perforce.p4java.impl.generic.core.Stream; import com.perforce.p4java.option.server.GetStreamOptions; import com.perforce.p4java.option.server.StreamOptions; +import com.perforce.p4java.option.server.ConvertSparseOptions; import com.perforce.p4java.server.IOptionsServer; import com.perforce.p4java.server.delegator.IStreamDelegator; import org.apache.commons.lang3.Validate; @@ -96,4 +98,26 @@ public String deleteStream( return parseCommandResultMapIfIsInfoMessageAsString(resultMaps); } + + @Override + public String convertSparseStream( + @Nonnull final ConvertSparseOptions opts) throws P4JavaException { + if (nonNull(opts.getOptions())) { + opts.getOptions().add(0, "convertsparse"); + } + else { + opts.setOptions("convertsparse"); + } + + if(opts.isConvertsparseSuppressMessage()) { + opts.getOptions().add("-q"); + } + + List> resultMaps = execMapCmdList( + STREAM, + processParameters(opts, server), + null); + + return parseCommandResultMapIfIsInfoMessageAsString(resultMaps); + } } diff --git a/src/main/java/com/perforce/p4java/option/server/ConvertSparseOptions.java b/src/main/java/com/perforce/p4java/option/server/ConvertSparseOptions.java new file mode 100644 index 0000000..1c1974e --- /dev/null +++ b/src/main/java/com/perforce/p4java/option/server/ConvertSparseOptions.java @@ -0,0 +1,85 @@ +/** + * + */ +package com.perforce.p4java.option.server; + +import com.perforce.p4java.exception.OptionsException; +import com.perforce.p4java.option.Options; +import com.perforce.p4java.server.IServer; + +import java.util.List; + +/** + * Options subclass for the sparse stream convert. + */ +public class ConvertSparseOptions extends Options { + + /** + * Options: -q + */ + public static final String OPTIONS_SPECS = "b:q"; + + /** + * If true, suppress normal output messages. Messages regarding + * errors or exceptional conditions are displayed. + * Corresponds to the -q flag. + * */ + public boolean suppressMessage = false; + + /** + * Default constructor. + */ + public ConvertSparseOptions() { + super(); + } + + /** + * Strings-based constructor; see 'p4 help [command]' for possible options. + *

+ * + * WARNING: you should not pass more than one option or argument in each + * string parameter. Each option or argument should be passed-in as its own + * separate string parameter, without any spaces between the option and the + * option value (if any). + *

+ * + * NOTE: setting options this way always bypasses the internal options + * values, and getter methods against the individual values corresponding to + * the strings passed in to this constructor will not normally reflect the + * string's setting. Do not use this constructor unless you know what you're + * doing and / or you do not also use the field getters and setters. + * + * @param options options + * @see com.perforce.p4java.option.Options#Options(java.lang.String...) + */ + public ConvertSparseOptions(String... options) { + super(options); + } + + /** + * Explicit-value constructor. + * + * @param suppressMessage suppressMessage + */ + public ConvertSparseOptions(boolean suppressMessage) { + super(); + this.suppressMessage = suppressMessage; + } + + /** + * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) + */ + public List processOptions(IServer server) throws OptionsException { + this.optionList = this.processFields(OPTIONS_SPECS, this.isConvertsparseSuppressMessage()); + return this.optionList; + } + + public boolean isConvertsparseSuppressMessage() { + return suppressMessage; + } + + public ConvertSparseOptions setConvertsparseSuppressMessage(boolean suppressMessage) { + this.suppressMessage = suppressMessage; + return this; + } +} \ No newline at end of file diff --git a/src/main/java/com/perforce/p4java/option/server/GetBranchSpecsOptions.java b/src/main/java/com/perforce/p4java/option/server/GetBranchSpecsOptions.java index 3692770..eb64e85 100644 --- a/src/main/java/com/perforce/p4java/option/server/GetBranchSpecsOptions.java +++ b/src/main/java/com/perforce/p4java/option/server/GetBranchSpecsOptions.java @@ -19,7 +19,7 @@ public class GetBranchSpecsOptions extends Options { /** * Options: -u[user], -e[nameFilter], -E[nameFilter], -m[max], -t */ - public static final String OPTIONS_SPECS = "s:u s:e s:E i:m:gtz b:t"; + public static final String OPTIONS_SPECS = "s:u b:-user-case-insensitive s:e s:E i:m:gtz b:t"; /** * If non-null, limit qualifying branches to those owned by the named user. @@ -27,6 +27,12 @@ public class GetBranchSpecsOptions extends Options { */ protected String userName = null; + /** + * If positive, flag indicates that the user + * value is a case-insensitive search pattern + */ + protected boolean userCaseInsensitive = false; + /** * If non-null, limits output to branches whose name matches * the nameFilter pattern. Corresponds to -enameFilter flag @@ -130,7 +136,7 @@ public GetBranchSpecsOptions(boolean showTime, String userName, String caseInsen * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List processOptions(IServer server) throws OptionsException { - this.optionList = this.processFields(OPTIONS_SPECS, this.getUserName(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.getMaxResults(), this.isShowTime()); + this.optionList = this.processFields(OPTIONS_SPECS, this.getUserName(), this.isUserCaseInsensitive(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.getMaxResults(), this.isShowTime()); return this.optionList; } @@ -143,6 +149,13 @@ public GetBranchSpecsOptions setUserName(String userName) { return this; } + public boolean isUserCaseInsensitive() { return this.userCaseInsensitive; } + + public GetBranchSpecsOptions setUserCaseInsensitiveSubOption(boolean userCaseInsensitive) { + this.userCaseInsensitive = userCaseInsensitive; + return this; + } + public String getNameFilter() { return nameFilter; } diff --git a/src/main/java/com/perforce/p4java/option/server/GetChangelistsOptions.java b/src/main/java/com/perforce/p4java/option/server/GetChangelistsOptions.java index 67e4935..bd690a3 100644 --- a/src/main/java/com/perforce/p4java/option/server/GetChangelistsOptions.java +++ b/src/main/java/com/perforce/p4java/option/server/GetChangelistsOptions.java @@ -8,6 +8,7 @@ import com.perforce.p4java.option.Options; import com.perforce.p4java.server.IServer; +import java.util.ArrayList; import java.util.List; /** @@ -18,9 +19,9 @@ public class GetChangelistsOptions extends Options { /** - * Options: -i, -l, -c[client], -m[max], -s[status], -u[user], -f, -L + * Options: -i, -l, -c[client [-E | --client-case-insensitive]], -m[max], -s[status], -u[user [-E | --user-case-insensitive]], -f, -L */ - public static final String OPTIONS_SPECS = "b:i b:l s:c i:m:gtz s:s s:u b:f b:L"; + public static final String OPTIONS_SPECS = "b:i b:l s:c b:-client-case-insensitive i:m:gtz s:s s:u b:-user-case-insensitive b:f b:L"; /** * If positive, restrict the list to the maxMostRecent most recent changelists. @@ -34,12 +35,24 @@ public class GetChangelistsOptions extends Options { */ protected String clientName = null; + /** + * If positive, flag indicates that the client + * value is a case-insensitive search pattern + */ + protected boolean clientCaseInsensitive = false; + /** * If non-null, restrict the results to changelists associated * with the given user name. Corresponds to -uuser flag. */ protected String userName = null; + /** + * If positive, flag indicates that the user + * value is a case-insensitive search pattern + */ + protected boolean userCaseInsensitive = false; + /** * If true, also include any changelists integrated into the * specified files (if any). Corresponds to -i flag. @@ -173,7 +186,12 @@ public GetChangelistsOptions(int maxMostRecent, String clientName, String userNa * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List processOptions(IServer server) throws OptionsException { - this.optionList = this.processFields(OPTIONS_SPECS, this.includeIntegrated, this.isLongDesc(), this.getClientName(), this.getMaxMostRecent(), (this.getType() == null ? null : this.getType().toString()), this.getUserName(), this.isViewRestricted(), this.isTruncateDescriptions()); + if (this.optionList == null) { + this.optionList = this.processFields(OPTIONS_SPECS, this.includeIntegrated, this.isLongDesc(), this.getClientName(), this.isClientCaseInsensitive(), this.getMaxMostRecent(), (this.getType() == null ? null : this.getType().toString()), this.getUserName(), this.isUserCaseInsensitive(), this.isViewRestricted(), this.isTruncateDescriptions()); + } else { + this.optionList.addAll(this.processFields(OPTIONS_SPECS, this.includeIntegrated, this.isLongDesc(), this.getClientName(), this.isClientCaseInsensitive(), this.getMaxMostRecent(), (this.getType() == null ? null : this.getType().toString()), this.getUserName(), this.isUserCaseInsensitive(), this.isViewRestricted(), this.isTruncateDescriptions())); + } + return this.optionList; } @@ -195,6 +213,13 @@ public GetChangelistsOptions setClientName(String clientName) { return this; } + public boolean isClientCaseInsensitive() { return this.clientCaseInsensitive; } + + public GetChangelistsOptions setClientCaseInsensitiveSubOption(boolean clientCaseInsensitive) { + this.clientCaseInsensitive = clientCaseInsensitive; + return this; + } + public String getUserName() { return userName; } @@ -204,6 +229,13 @@ public GetChangelistsOptions setUserName(String userName) { return this; } + public boolean isUserCaseInsensitive() { return this.userCaseInsensitive; } + + public GetChangelistsOptions setUserCaseInsensitiveSubOption(boolean userCaseInsensitive) { + this.userCaseInsensitive = userCaseInsensitive; + return this; + } + public boolean isIncludeIntegrated() { return includeIntegrated; } @@ -257,4 +289,28 @@ public GetChangelistsOptions setTruncateDescriptions(boolean truncateDescription this.truncateDescriptions = truncateDescriptions; return this; } + + public GetChangelistsOptions setMultipleClientNames(String... multipleClientNames) { + if (this.optionList == null) { + this.optionList = new ArrayList<>(); + } + + for (String str : multipleClientNames) { + this.optionList.add("-c"+str); + } + + return this; + } + + public GetChangelistsOptions setMultipleUserNames(String... multipleUserNames) { + if (this.optionList == null) { + this.optionList = new ArrayList<>(); + } + + for (String str : multipleUserNames) { + this.optionList.add("-u"+str); + } + + return this; + } } diff --git a/src/main/java/com/perforce/p4java/option/server/GetClientsOptions.java b/src/main/java/com/perforce/p4java/option/server/GetClientsOptions.java index 189f3cf..c3249fe 100644 --- a/src/main/java/com/perforce/p4java/option/server/GetClientsOptions.java +++ b/src/main/java/com/perforce/p4java/option/server/GetClientsOptions.java @@ -17,11 +17,11 @@ public class GetClientsOptions extends Options { /** - * Options: -m[max], -u[user], -e[nameFilter], -E[nameFilter], -t, -S[stream] + * Options: -m[max], -u[user[--user-case-insensitive]], -e[nameFilter], -E[nameFilter], -t, -S[stream] *

* Options: -U */ - public static final String OPTIONS_SPECS = "i:m:gtz s:u s:e s:E b:t s:S b:U"; + public static final String OPTIONS_SPECS = "i:m:gtz s:u b:-user-case-insensitive s:e s:E b:t s:S b:U"; /** * If non-null, limit qualifying clients to those owned by the named user. @@ -29,6 +29,12 @@ public class GetClientsOptions extends Options { */ protected String userName = null; + /** + * If positive, flag indicates that the user + * value is a case-insensitive search pattern + */ + protected boolean userCaseInsensitive = false; + /** * If non-null, limits output to clients whose name matches * the nameFilter pattern. Corresponds to -enameFilter flag @@ -163,7 +169,7 @@ public GetClientsOptions(boolean showTime, String userName, String caseInsensiti * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List processOptions(IServer server) throws OptionsException { - this.optionList = this.processFields(OPTIONS_SPECS, this.getMaxResults(), this.getUserName(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.isShowTime(), this.getStream(), this.isUnloaded()); + this.optionList = this.processFields(OPTIONS_SPECS, this.getMaxResults(), this.getUserName(), this.isUserCaseInsensitive(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.isShowTime(), this.getStream(), this.isUnloaded()); return this.optionList; } @@ -185,6 +191,13 @@ public GetClientsOptions setUserName(String userName) { return this; } + public boolean isUserCaseInsensitive() { return this.userCaseInsensitive; } + + public GetClientsOptions setUserCaseInsensitiveSubOption(boolean userCaseInsensitive) { + this.userCaseInsensitive = userCaseInsensitive; + return this; + } + public String getNameFilter() { return nameFilter; } diff --git a/src/main/java/com/perforce/p4java/option/server/GetLabelsOptions.java b/src/main/java/com/perforce/p4java/option/server/GetLabelsOptions.java index 3c16e01..c6a465f 100644 --- a/src/main/java/com/perforce/p4java/option/server/GetLabelsOptions.java +++ b/src/main/java/com/perforce/p4java/option/server/GetLabelsOptions.java @@ -17,11 +17,11 @@ public class GetLabelsOptions extends Options { /** - * Options: -m[max], -u[user], -e[nameFilter], -E[nameFilter], -t + * Options: -m[max], -u[user[--user-case-insensitive]], -e[nameFilter], -E[nameFilter], -t *

* Options: -U */ - public static final String OPTIONS_SPECS = "i:m:gtz s:u s:e s:E b:t b:U"; + public static final String OPTIONS_SPECS = "i:m:gtz s:u b:-user-case-insensitive s:e s:E b:t b:U"; /** * If non-null, limit qualifying labels to those owned by the named user. @@ -29,6 +29,12 @@ public class GetLabelsOptions extends Options { */ protected String userName = null; + /** + * If positive, flag indicates that the user + * value is a case-insensitive search pattern + */ + protected boolean userCaseInsensitive = false; + /** * If non-null, limits output to labels whose name matches * the nameFilter pattern. Corresponds to -enameFilter flag @@ -137,7 +143,7 @@ public GetLabelsOptions(boolean showTime, String userName, String caseInsensitiv * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List processOptions(IServer server) throws OptionsException { - this.optionList = this.processFields(OPTIONS_SPECS, this.getMaxResults(), this.getUserName(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.isShowTime(), this.isUnloaded()); + this.optionList = this.processFields(OPTIONS_SPECS, this.getMaxResults(), this.getUserName(), this.isUserCaseInsensitive(), this.getNameFilter(), this.getCaseInsensitiveNameFilter(), this.isShowTime(), this.isUnloaded()); return this.optionList; } @@ -159,6 +165,13 @@ public GetLabelsOptions setUserName(String userName) { return this; } + public boolean isUserCaseInsensitive() { return this.userCaseInsensitive; } + + public GetLabelsOptions setUserCaseInsensitiveSubOption(boolean userCaseInsensitive) { + this.userCaseInsensitive = userCaseInsensitive; + return this; + } + public String getNameFilter() { return nameFilter; } diff --git a/src/main/java/com/perforce/p4java/option/server/GetProtectionEntriesOptions.java b/src/main/java/com/perforce/p4java/option/server/GetProtectionEntriesOptions.java index 71e12bb..8a40d8b 100644 --- a/src/main/java/com/perforce/p4java/option/server/GetProtectionEntriesOptions.java +++ b/src/main/java/com/perforce/p4java/option/server/GetProtectionEntriesOptions.java @@ -17,9 +17,9 @@ public class GetProtectionEntriesOptions extends Options { /** - * Options: -a, -g[group], -u[user], -h[host] + * Options: -a, -g[group], -u[user], -h[host], -m */ - public static final String OPTIONS_SPECS = "b:a s:g s:u s:h"; + public static final String OPTIONS_SPECS = "b:a s:g s:u s:h b:m"; /** If true,protection lines for all users are displayed; corresponds to the -a flag. */ protected boolean allUsers = false; @@ -34,6 +34,9 @@ public class GetProtectionEntriesOptions extends Options { /** If not null, protection lines for the named group are displayed; -g flag */ protected String groupName = null; + /** If not null, a single word summary of the maximum access level is reported; -m flag */ + protected boolean singleWordSummary = false; + /** * Default constructor. */ @@ -84,7 +87,7 @@ public GetProtectionEntriesOptions(boolean allUsers, String hostName, String use * @see com.perforce.p4java.option.Options#processOptions(com.perforce.p4java.server.IServer) */ public List processOptions(IServer server) throws OptionsException { - this.optionList = this.processFields(OPTIONS_SPECS, this.isAllUsers(), this.getGroupName(), this.getUserName(), this.getHostName()); + this.optionList = this.processFields(OPTIONS_SPECS, this.isAllUsers(), this.getGroupName(), this.getUserName(), this.getHostName(), this.isSingleWordSummary()); return this.optionList; } @@ -123,4 +126,11 @@ public GetProtectionEntriesOptions setGroupName(String groupName) { this.groupName = groupName; return this; } + + public boolean isSingleWordSummary() { return singleWordSummary; } + + public GetProtectionEntriesOptions setSingleWordSummary(boolean singleWordSummary) { + this.singleWordSummary = singleWordSummary; + return this; + } } diff --git a/src/main/java/com/perforce/p4java/server/delegator/IStreamDelegator.java b/src/main/java/com/perforce/p4java/server/delegator/IStreamDelegator.java index 0258128..5bbc113 100644 --- a/src/main/java/com/perforce/p4java/server/delegator/IStreamDelegator.java +++ b/src/main/java/com/perforce/p4java/server/delegator/IStreamDelegator.java @@ -6,6 +6,7 @@ import com.perforce.p4java.exception.P4JavaException; import com.perforce.p4java.option.server.GetStreamOptions; import com.perforce.p4java.option.server.StreamOptions; +import com.perforce.p4java.option.server.ConvertSparseOptions; /** * Interface to handle the Stream command. @@ -89,4 +90,18 @@ String updateStream(IStream stream, StreamOptions opts) */ String deleteStream(String streamPath, StreamOptions opts) throws P4JavaException; + + /** + * Convert Sparse stream to development and release stream from the Perforce server. + * + * @param opts ConvertsparseOptions object describing optional parameters; if null, + * no options are set. + * @return non-null result message string from the Perforce server; this may + * include form trigger output pre-pended and / or appended to the + * "normal" message + * @throws P4JavaException if any error occurs in the processing of this method. + * @since 2024.2 + */ + String convertSparseStream(ConvertSparseOptions opts) + throws P4JavaException; }