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 { private 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 int getPort() { return port; } private String host; private int port = 1666; public P4Port( String p4Port ) { 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 = Integer.parseInt( tokens[1] ); break; case 1: host = tokens[0]; break; default: throw new IllegalArgumentException( "Illegal p4port settings: " + originalP4Port ); } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 9519 | dantran | folder rename to match with its artifactId | ||
#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) |