package com.perforce.maven.scm.provider.p4.util; import java.util.Arrays; import java.util.HashSet; import org.codehaus.plexus.util.StringUtils; public class P4Port { public static final String[] PROTOCOLS = { "tcp", "tcp4", "tcp6", "tcp46", "tcp64", "ssl", "ssl4", "ssl6", "ssl46", "ssl64" }; private String protocol; public String getProtocol() { return protocol; } public String getHost() { return host; } public String getPort() { return port; } private String host; private String port; public P4Port( String p4Port ) { if ( StringUtils.isBlank( p4Port ) ) { return; } String originalP4Port = p4Port; // extract protocol String protocol = null; int i0 = p4Port.indexOf( ":" ); if ( i0 > 0 ) { protocol = p4Port.substring( 0, i0 ); HashSet<String> protocols = new HashSet<String>( Arrays.asList( PROTOCOLS ) ); if ( protocols.contains( protocol ) ) { p4Port = p4Port.substring( i0 + 1 ); } else { protocol = null; } } String[] tokens = StringUtils.split( p4Port, ":" ); switch ( tokens.length ) { case 2: host = tokens[0]; port = tokens[1]; break; case 1: host = tokens[0]; break; default: throw new IllegalArgumentException( "Illegal p4port settings: " + originalP4Port ); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 11616 | dantran | Honor P4USER env | ||
#6 | 9628 | dantran | better P4ScmUrl parser | ||
#5 | 9590 | dantran |
- add option to fail tag when it already exist - add P4ScmUrl parser test - cleanup |
||
#4 | 9548 | dantran |
- pickup P4PORT form env and system properties to support multi site using proxy - add development doc - check for error after each action |
||
#3 | 9533 | dantran | source format | ||
#2 | 9528 | dantran | Isolate P2 url parsing task into its own class to be reusable by test | ||
#1 | 9519 | dantran | folder rename to match with its artifactId | ||
//guest/dantran/p4maven/com.perforce.maven/src/main/java/com/perforce/maven/scm/provider/p4/util/P4Port.java | |||||
#1 | 9514 | dantran |
- Remove support to pick up p4port and its credential from ENV and System properties. These setttings has no use since Maven requires user to provide the required URL which has both p4port and credential. Also user can always fall back to settings.xml to store credential - Rewrite URL parser and also support password as part of URL - TCK test now has default URL and its credential is store under settings.xml - User can also issue her how scmTckUrl system properties ( to be doc as part of maven site) |