Remove unused methods, fix separator character

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@376589 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
ltheussl committed 2006-02-10 08:07:04 +00:00
1 parent a8a119ccc3
commit e5648c1ba0
1 file changed
+4 -81
@@ -49,84 +49,9 @@ public final class ScmUtil
return null;
}
/**
* Get cvs root.
*
* @param scmConnection the scm connection to analyse.
* @return CVS root.
*/
public String getCvsRoot( String scmConnection )
{
if ( isValid( scmConnection ) )
{
return getCvsRoot( scmConnection, "" );
}
return null;
}
/**
* Get cvs server. Used in
* xdocs/src/plugin-resources/templates/cvs-usage.xml.
*
* @param conn six token connection string
* @return CVS module.
*/
public String getCvsServer( String conn )
{
String[] tokens = splitSCMConnection( conn );
if ( !tokens[1].equals( "cvs" ) )
{
return "";
}
if ( tokens[3].indexOf( '@' ) >= 0 )
{
return tokens[3].substring( tokens[3].indexOf( '@' ) + 1 );
}
else
{
return tokens[3];
}
}
/**
* Get cvs root. Used in xdocs/src/plugin-resources/templates/cvs-usage.xml.
*
* @param conn six token connection string
* @param username username override if non-empty.
* @return CVS root.
*/
public String getCvsRoot( String conn, String username )
{
String[] tokens = splitSCMConnection( conn );
if ( !tokens[1].equals( "cvs" ) )
{
return "";
}
if ( tokens[3].indexOf( '@' ) >= 0 )
{
if ( username.length() == 0 )
{
username = tokens[3].substring( 0, tokens[3].indexOf( '@' ) );
}
tokens[3] =
username + "@"
+ tokens[3].substring( tokens[3].indexOf( '@' ) + 1 );
}
String result = ":" + tokens[2] + ":" + tokens[3] + ":" + tokens[4];
return result;
}
/**
* Get cvs connection string.
* Used in xdocs/src/plugin-resources/templates/cvs-usage.xml.
* Used in xdocs/src/plugin-resources/templates/scm/cvs.xml.
* If username == "", assumes anonymous (pserver) connection. In this case,
* inserts a separator (':' or '|') between the username and '@' to indicate
* that there is a password and that it is empty.
@@ -145,9 +70,7 @@ public final class ScmUtil
return "";
}
// The length of conn has already been checked in the call to
// splitSCMConnection(conn) above, so it's OK to just extract the char.
String separator = "" + conn.charAt( 3 );
String separator = getSCMConnectionSeparator( conn );
if ( tokens[3].indexOf( '@' ) >= 0 )
{
@@ -164,7 +87,7 @@ public final class ScmUtil
}
String result =
tokens[0] + separator + tokens[1] + separator + tokens[2]
tokens[0] + ":" + tokens[1] + separator + tokens[2]
+ separator + tokens[3] + separator + tokens[4] + separator
+ tokens[5];
@@ -173,7 +96,7 @@ public final class ScmUtil
/**
* Get cvs module. Used in
* xdocs/src/plugin-resources/templates/cvs-usage.xml.
* xdocs/src/plugin-resources/templates/scm/cvs.xml.
*
* @param conn six token connection string
* @return CVS module.